Re: [Haskell-cafe] Questions about the Functor class and it's use in "Data types à la carte"

Roberto Zunino zunino at di.unipi.it
Sun Dec 16 07:25:48 EST 2007


Yitzchak Gale wrote:
> When using seq and _|_ in the context of categories,
> keep in mind that Haskell "composition" (.)
> is not really composition in the category-theoretic
> sense, because it adds extra laziness. Use this
> instead:
> 
> (.!) f g x = f `seq` g `seq` f (g x)

   id .! undefined
== \x -> undefined
/= undefined

Probably you meant

   (.!) f g = f `seq` g `seq` (f . g)

Zun.


More information about the Haskell-Cafe mailing list