I had a lot of data in a table in an Excel spreadsheet file and I was planning to use Haskell to analyse it. The data would be better structured as a database. Microsoft Office 365 provides Access, a database management system (DBMS). Could Haskell access data in an Access .accdb file? The short answer […]
Out of sequence
The Haskell language provides the list type ([a]) for values that correspond to a finite sequence of values of the same type (a). Other packages export other types that do the same: containers exports Seq a and vector exports Vector a from module Data.Vector and other types from other modules. The values of the different […]
Indexing with fixed-size vectors
In August 2017, Jason Le identified the vector-sized package as the canonical source for efficient fixed-size vectors. Module Data.Vector.Generic.Sized.Internal of the package exports a new type Vector defined as:
1 2 3 4 5 |
newtype Vector v (n :: Nat) a = Vector (v a) deriving ( Show, Eq, Ord, Functor, Foldable, Traversable, NFData, Generic , Show1, Eq1, Ord1 , Data, Typeable ) |
and module Data.Vector.Sized defines the type synonym Vector (where Data.Vector is a module of the vector package):
1 2 3 4 |
import qualified Data.Vector.Generic.Sized as V import qualified Data.Vector as VU type Vector = V.Vector VU.Vector |
As shown above, instances of Vector v […]
zlib1.dll and conflicts
Certain Haskell libraries depend on C library GTK+ or its dependencies (such as Cairo or Pango). The dependencies include zlib, a compression library. On Windows, these libraries can be obtained most easily using MSYS2. The DLL build of zlib is named zlib1.dll. zlib has developed over time and later versions of zlib1.dll export functions that […]
It’s a kind of magic
Sandy Maguire is working on a book about type-level programming in Haskell with the working title of The Book of Types. It has prompted me to take stock of what I know about kinds. Haskell 2010 Language Report My starting point is the Haskell 2010 Language Report. It explains that the main forms of type […]
Further from the Path
My Path user environment variable includes references to other environment variables, for example (extract):
1 2 3 4 |
C:\> reg query HKEY_CURRENT_USER\Environment /v Path HKEY_CURRENT_USER\Environment PATH REG_EXPAND_SZ %USERPROFILE%\AppData\Local\Microsoft\WindowsApps; |
Suddenly, I was no longer reaching certain locations on the path. I discovered that the references to other environment variables were not being expanded.
1 2 3 |
C:\> set Path Path=%USERPROFILE%\AppData\Local\Microsoft\WindowsApps; |
Somehow, the type of Path in the registry had been changed from REG_EXPAND_SZ to REG_SZ, […]
Grokking monads
It has been said that the world does not need yet another monad tutorial. Hal Daume III’s Yet Another Haskell Tutorial (copyright 2002 to 2006) is available as a Wikibook and there is a featured wikibook on Haskell itself. The November 2008 edition of Real World Haskell by Bryan O’Sullivan, Don Stewart, and John Goerzen […]
Highlighting Haskell
In March 2012, I discovered the Codea app, allowing coding on an iPad, and the Lua programming language, its foundation. That was the unlikely seed for discovering the functional programming language Haskell in late 2013: a Codea discussion mentioned Project Euler and Haskell solutions to its problems. In particular, a one-line solution for Problem 9: […]
Rebuilding a Mac mini
In January 2012, I wanted to learn Apple’s Objective-C programming language, so I bought a basic Mac mini and a book. The Mac was a ‘mid 2011’ model, configured with a 2.3 GHz Intel Core i5 processor, 2 GB of RAM and a 500 GB hard drive. The book was Programming in Objective-C by Stephen […]
Experiments with IIS and PHP
After many years of hand-tooling HTML, I bit the bullet and installed WordPress. That has sparked an interest in PHP, the server-side scripting language. I needed a local copy to experiment with. Turning on IIS First, I needed web server software. The operating system on my PC is currently 64-bit Windows 10 and Windows comes […]