Outline
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
module Data.Maybe ( module Prelude.Maybe, listToMaybeconstant `Data.Maybe.listToMaybe` constant type `['a] -> Maybe 'a` executable, maybeToListconstant `Data.Maybe.maybeToList` constant type `Maybe 'a -> ['a]` executable, catMaybesconstant `Data.Maybe.catMaybes` constant type `[(Maybe 'a)] -> ['a]` executable, mapMaybeconstant `Data.Maybe.mapMaybe` constant type `('a -> Maybe 'b) -> ['a] -> ['b]` executable ) where declare listToMaybeconstant `Data.Maybe.listToMaybe` constant type `['a] -> Maybe 'a` executable :: ['atype-variable `'a` kind `*`] -> Maybedatatype `Prelude.Maybe.Maybe` kind `* -> *` executable 'atype-variable `'a` kind `*` define listToMaybeconstant `Data.Maybe.listToMaybe` constant type `['a] -> Maybe 'a` executable [] := Nothingconstant `Prelude.Maybe.Nothing` constructor of datatype `Maybe` type `Maybe 'a` executable | listToMaybeconstant `Data.Maybe.listToMaybe` constant type `['a] -> Maybe 'a` executable (xvariable `x` type `'a`:constant `Prelude.List.(:)` constructor of datatype `List` type `'a -> ['a] -> ['a]` executable_) := Justconstant `Prelude.Maybe.Just` constructor of datatype `Maybe` type `'a -> Maybe 'a` executable xvariable `x` type `'a` declare maybeToListconstant `Data.Maybe.maybeToList` constant type `Maybe 'a -> ['a]` executable :: Maybedatatype `Prelude.Maybe.Maybe` kind `* -> *` executable 'atype-variable `'a` kind `*` -> ['atype-variable `'a` kind `*`] define maybeToListconstant `Data.Maybe.maybeToList` constant type `Maybe 'a -> ['a]` executable Nothingconstant `Prelude.Maybe.Nothing` constructor of datatype `Maybe` type `Maybe 'a` executable := [] | maybeToListconstant `Data.Maybe.maybeToList` constant type `Maybe 'a -> ['a]` executable (Justconstant `Prelude.Maybe.Just` constructor of datatype `Maybe` type `'a -> Maybe 'a` executable vvariable `v` type `'a`) := [vvariable `v` type `'a`] declare catMaybesconstant `Data.Maybe.catMaybes` constant type `[(Maybe 'a)] -> ['a]` executable :: [Maybedatatype `Prelude.Maybe.Maybe` kind `* -> *` executable 'atype-variable `'a` kind `*`] -> ['atype-variable `'a` kind `*`] define rec catMaybesconstant `Data.Maybe.catMaybes` constant type `[(Maybe 'a)] -> ['a]` executable [] := [] | catMaybesconstant `Data.Maybe.catMaybes` constant type `[(Maybe 'a)] -> ['a]` executable (Nothingconstant `Prelude.Maybe.Nothing` constructor of datatype `Maybe` type `Maybe 'a` executable:constant `Prelude.List.(:)` constructor of datatype `List` type `'a -> ['a] -> ['a]` type in context `Maybe 'a -> [(Maybe 'a)] -> [(Maybe 'a)]` executablevsvariable `vs` type `[(Maybe 'a)]`) := catMaybesconstant `Data.Maybe.catMaybes` (recursive usage) constant type `[(Maybe 'a)] -> ['a]` executable vsvariable `vs` type `[(Maybe 'a)]` | catMaybesconstant `Data.Maybe.catMaybes` constant type `[(Maybe 'a)] -> ['a]` executable ((Justconstant `Prelude.Maybe.Just` constructor of datatype `Maybe` type `'a -> Maybe 'a` executable vvariable `v` type `'a`):constant `Prelude.List.(:)` constructor of datatype `List` type `'a -> ['a] -> ['a]` type in context `Maybe 'a -> [(Maybe 'a)] -> [(Maybe 'a)]` executablevsvariable `vs` type `[(Maybe 'a)]`) := vvariable `v` type `'a` :constant `Prelude.List.(:)` constructor of datatype `List` type `'a -> ['a] -> ['a]` executable (catMaybesconstant `Data.Maybe.catMaybes` (recursive usage) constant type `[(Maybe 'a)] -> ['a]` executable vsvariable `vs` type `[(Maybe 'a)]`) declare mapMaybeconstant `Data.Maybe.mapMaybe` constant type `('a -> Maybe 'b) -> ['a] -> ['b]` executable :: ('atype-variable `'a` kind `*` -> Maybedatatype `Prelude.Maybe.Maybe` kind `* -> *` executable 'btype-variable `'b` kind `*`) -> ['atype-variable `'a` kind `*`] -> ['btype-variable `'b` kind `*`] define rec mapMaybeconstant `Data.Maybe.mapMaybe` constant type `('a -> Maybe 'b) -> ['a] -> ['b]` executable _ [] := [] | mapMaybeconstant `Data.Maybe.mapMaybe` constant type `('a -> Maybe 'b) -> ['a] -> ['b]` executable mfvariable `mf` type `'a -> Maybe 'b` (vvariable `v` type `'a` :constant `Prelude.List.(:)` constructor of datatype `List` type `'a -> ['a] -> ['a]` executable vsvariable `vs` type `['a]`) := case (mfvariable `mf` type `'a -> Maybe 'b` vvariable `v` type `'a`) of Nothingconstant `Prelude.Maybe.Nothing` constructor of datatype `Maybe` type `Maybe 'a` type in context `Maybe 'b` executable -> mapMaybeconstant `Data.Maybe.mapMaybe` (recursive usage) constant type `('a -> Maybe 'b) -> ['a] -> ['b]` executable mfvariable `mf` type `'a -> Maybe 'b` vsvariable `vs` type `['a]` | (Justconstant `Prelude.Maybe.Just` constructor of datatype `Maybe` type `'a -> Maybe 'a` type in context `'b -> Maybe 'b` executable xvariable `x` type `'b`) -> xvariable `x` type `'b`:constant `Prelude.List.(:)` constructor of datatype `List` type `'a -> ['a] -> ['a]` type in context `'b -> ['b] -> ['b]` executable(mapMaybeconstant `Data.Maybe.mapMaybe` (recursive usage) constant type `('a -> Maybe 'b) -> ['a] -> ['b]` executable mfvariable `mf` type `'a -> Maybe 'b` vsvariable `vs` type `['a]`) end end-moduleend of module Data.Maybe