Prelude/Either.ad

Outline

Content

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Prelude.Either (
  Eitherdatatype `Prelude.Either.Either`
   kind `* -> * -> *`
   executable(..)case-constant `caseEither`
constructor `Left`
constructor `Right`
,
  destEitherconstant `Prelude.Either.destEither`
   constant
   type `('a -> 'c) -> ('b -> 'c) -> Either 'a 'b -> 'c`
   executable
) where

{-# NoImplicitPrelude #-}
import Prelude.Bool
import Prelude.Eq
import Prelude.Ord

datatype Eitherdatatype `Prelude.Either.Either`
   kind `* -> * -> *`
   executable 'atype-variable `'a`
   kind `*` 'btype-variable `'b`
   kind `*` :=
    Left 'atype-variable `'a`
   kind `*`
  | Right 'btype-variable `'b`
   kind `*`


declare destEitherconstant `Prelude.Either.destEither`
   constant
   type `('a -> 'c) -> ('b -> 'c) -> Either 'a 'b -> 'c`
   executable :: ('atype-variable `'a`
   kind `*` -> 'ctype-variable `'c`
   kind `*`) -> ('btype-variable `'b`
   kind `*` -> 'ctype-variable `'c`
   kind `*`) -> Eitherdatatype `Prelude.Either.Either`
   kind `* -> * -> *`
   executable 'atype-variable `'a`
   kind `*` 'btype-variable `'b`
   kind `*` -> 'ctype-variable `'c`
   kind `*`
define destEitherconstant `Prelude.Either.destEither`
   constant
   type `('a -> 'c) -> ('b -> 'c) -> Either 'a 'b -> 'c`
   executable lfvariable `lf`
   type `'a -> 'c` _ (Leftconstant `Prelude.Either.Left`
   constructor of datatype `Either`
   type `'a -> Either 'a 'b`
   executable vvariable `v`
   type `'a`)  := lfvariable `lf`
   type `'a -> 'c` vvariable `v`
   type `'a`
     | destEitherconstant `Prelude.Either.destEither`
   constant
   type `('a -> 'c) -> ('b -> 'c) -> Either 'a 'b -> 'c`
   executable _ rfvariable `rf`
   type `'b -> 'c` (Rightconstant `Prelude.Either.Right`
   constructor of datatype `Either`
   type `'b -> Either 'a 'b`
   executable vvariable `v`
   type `'b`) := rfvariable `rf`
   type `'b -> 'c` vvariable `v`
   type `'b`

derive Eitherdatatype `Prelude.Either.Either`
   kind `* -> * -> *`
   executable instances (EqPtype-class `Prelude.Eq.EqP`
   arguments: ('a :: *)
   has default derive templates
   derive-template labels
     - eq (only deriving)
     - full
generated code: instance (EqP 'a, EqP 'b) => EqP (Either 'a 'b) where define non-exec (===) (Left x1) (Left y1) := (x1 === y1) | (===) (Right x1) (Right y1) := (x1 === y1) | (===) _ _ := false end-instance
, Eqtype-class `Prelude.Eq.Eq` arguments: ('a :: *) super-class constraints: - Prelude.Eq.EqP 'a has default derive templates
generated code: instance (Eq 'a, Eq 'b) => Eq (Either 'a 'b) where define (==) (Left x1) (Left y1) := (x1 == y1) | (==) (Right x1) (Right y1) := (x1 == y1) | (==) _ _ := False end-instance
, Ordtype-class `Prelude.Ord.Ord` arguments: ('a :: *) super-class constraints: - Prelude.Eq.Eq 'a has default derive templates
generated code: instance (Ord 'a, Ord 'b) => Ord (Either 'a 'b) where define compare (Left x1) (Left y1) := compare x1 y1 | compare (Left _) _ := LT | compare _ (Left _) := GT | compare (Right x1) (Right y1) := compare x1 y1 end-instance
)
end-moduleend of module Prelude.Either