Commit 90c555e9 authored by Steffen Michels's avatar Steffen Michels Committed by Mart Lubbers

add < instance for Maybe

parent 84f142fb
......@@ -5,7 +5,7 @@ definition module Data.Maybe
import StdMaybe
from StdOverloaded import class ==(..)
from StdOverloaded import class ==
from Data.Functor import class Functor
from Control.Applicative import class pure, class <*>, class Applicative, class *>, class <*, class Alternative
from Control.Monad import class Monad, class MonadPlus
......
definition module Data.Maybe.Ord
/**
* This contains a possible `<` and with this an `Ord` instance of the `Maybe` type.
* As there is no natural order and therefore an arbitrary choice is made,
* the instances is provided in a separate module. This makes is easier to use another ordering.
*/
from StdOverloaded import class <
from Data.Maybe import :: Maybe
instance < (Maybe a) | < a
implementation module Data.Maybe.Ord
import StdEnv, Data.Maybe
instance < (Maybe a) | < a where
< Nothing Nothing = False
< Nothing _ = True
< (Just a1) (Just a2) = a1 < a2
< _ _ = False
......@@ -123,6 +123,7 @@ import qualified Data.Map
import qualified Data.MapCollection
import qualified Data.Matrix
import qualified Data.Maybe
import qualified Data.Maybe.Ord
import qualified Data.Monoid
import qualified Data.NGramIndex
import qualified Data.OrdList
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment