Differences

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

Link to this comparison view

Both sides previous revision Previous revision
maybe [2014/09/15 20:18]
nikolaj
maybe [2014/09/15 20:19] (current)
nikolaj
Line 8: Line 8:
     (Just x) >>= k      = k x     (Just x) >>= k      = k x
     Nothing ​ >>= _      = Nothing     Nothing ​ >>= _      = Nothing
- 
-    (Just _) >> ​ k      = k 
-    Nothing ​ >> ​ _      = Nothing 
  
     return ​             = Just     return ​             = Just
     fail _              = Nothing     fail _              = Nothing
 +
 +-- utility
 +
 +   (Just _) >> ​ k      = k
 +   ​Nothing ​ >> ​ _      = Nothing
     ​     ​
--- instance ​ Functor Maybe  where +  ​instance ​ Functor Maybe  where 
---  ​fmap _ Nothing ​      = Nothing +    fmap _ Nothing ​      = Nothing 
---  ​fmap f (Just a)      = Just (f a)+    fmap f (Just a)      = Just (f a)
 </​code>​ </​code>​
  
Link to graph
Log In
Improvements of the human condition