[Haskell-cafe] Can I write this function without doing the action on a different line?
ky3 at atamo.com
Mon Apr 7 22:03:23 UTC 2014
On Sun, Apr 6, 2014 at 2:15 PM, Karl Voelker <karl at karlv.net> wrote:
> last . splitDirectories . normalise . joinPath . (: maybeToList package)
> <$> getCurrentDirectory
The thing to notice is that we really want to write
getCurrentDirectory : maybeToList package
but the effect-typing won't let us.
let x = flip (<$>) in getCurrentDirectory `x` (: maybeToList package)
restores the smile in our haskell, where 'x' can be as imperceptibly
unicoded as desired.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe