
1 May
2007
1 May
'07
5:47 a.m.
tphyahoo:
I was trying to follow the reasoning in Don's article on using haskell for shell scripting
http://cgi.cse.unsw.edu.au/~dons/blog/2007/03/10
In the source listing at the end we is
newtype Shell a = Shell { runShell :: ErrorT String IO a } deriving (Functor, Monad, MonadIO)
and I don't understand it what "deriving" is doing here, nor have I been able to find documentation on it.
That's 'cunning newtype deriving, my new favourite ghc language extension. http://www.haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html... We also use it in xmonad, newtype X a = X (ReaderT XConf (StateT XState IO) a) deriving (Functor, Monad, MonadIO, MonadState XState, MonadReader XConf) :-) -- Don