Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
hask [2015/12/08 19:03]
nikolaj
hask [2015/12/16 22:00]
nikolaj
Line 16: Line 16:
 Hask is the largest category of types in Haskell but you can find more well behaved categories. See also the [[http://​hackage.haskell.org/​package/​category-extras|category-extras]] package. Hask is the largest category of types in Haskell but you can find more well behaved categories. See also the [[http://​hackage.haskell.org/​package/​category-extras|category-extras]] package.
  
-Another deficit is that when it comes to passing functions as arguments, Haskell sees more than just Hask morphisms. A nicer definition of the largest category of Haskell would be if arrows weren'​t Haskell functions identified by function extensionally ($\forall x. f(x)=g(x)\implies f=g$), but rather identified if equivalent when passed to other Haskell functions as arguments ($\forall h. h(f)=h(g)\implies f=g$). However, this doesn'​t work: With the definition of concatenation given above, the category laws imply that '​(undefined :: Int -> Char).id'​ must be '\x ->​(undefined :: Int -> Char) x'. But there are functions which can detect the non-extensive property of '​undefined :: Int -> Char' being the '​undefined'​ term for the type 'Int -> Char'. The function '​seq'​ (which is implemented to make enforcement of strict evaluation possible) will return a different result when passed the extensionally equal functions '​undefined :: Int -> Char' and '\x ->​(undefined :: Int -> Char) x'​. ​+Another deficit is that when it comes to passing functions as arguments, Haskell sees more than just Hask morphisms. A nicer definition of the largest category of Haskell would be if arrows weren'​t Haskell functions identified by function extensionally ​ 
 +($\forall x. f(x)=g(x)\implies f=g$), ​ 
 +but rather identified if equivalent when passed to other Haskell functions as arguments ​ 
 +($\forall h. h(f)=h(g)\implies f=g$, see indiscernibility of identicals ​).  
 +However, this doesn'​t work: With the definition of concatenation given above, the category laws imply that '​(undefined :: Int -> Char).id'​ must be '\x ->​(undefined :: Int -> Char) x'. But there are functions which can detect the non-extensive property of '​undefined :: Int -> Char' being the '​undefined'​ term for the type 'Int -> Char'. The function '​seq'​ (which is implemented to make enforcement of strict evaluation possible) will return a different result when passed the extensionally equal functions '​undefined :: Int -> Char' and '\x ->​(undefined :: Int -> Char) x'​. ​
  
 === Functors === === Functors ===
Link to graph
Log In
Improvements of the human condition