Skip to content

Instantly share code, notes, and snippets.

@jaredly
Created August 13, 2020 18:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredly/a9799684663efe221f91fbca65d53ee0 to your computer and use it in GitHub Desktop.
Save jaredly/a9799684663efe221f91fbca65d53ee0 to your computer and use it in GitHub Desktop.

All the docs probably

base..

.> view base..

  (base..) : (b ->{𝕖} c) -> (a ->{𝕖} b) -> a ->{𝕖} c
  (base..) f g x = f (g x)

base.<|

.> view base.<|

  (base.<|) : (a ->{𝕖} b) -> a ->{𝕖} b
  f base.<| a = f a

base.Abort

.> view base.Abort

  ability base.Abort where abort : {base.Abort} a

base.Abort.abort

.> view base.Abort.abort

  ability base.Abort where abort : {base.Abort} a

base.Abort.tests.ex1

.> view base.Abort.tests.ex1

  base.Abort.tests.ex1 : [Result]
  base.Abort.tests.ex1 = check (toOptional 'abort == None)

base.Abort.tests.ex2

.> view base.Abort.tests.ex2

  base.Abort.tests.ex2 : [Result]
  base.Abort.tests.ex2 =
    use Nat +
    check (toOptional '(1 + abort) == None)

base.Abort.tests.ex3

.> view base.Abort.tests.ex3

  base.Abort.tests.ex3 : [Result]
  base.Abort.tests.ex3 =
    use Nat +
    check (toOptional '(toAbort (Some 1) + 1) == Some 2)

base.Abort.toOptional

.> view base.Abort.toOptional

  base.Abort.toOptional : '{g, Abort} a ->{g} Optional a
  base.Abort.toOptional a = handle !a with toOptional.handler

base.Abort.toOptional.handler

.> view base.Abort.toOptional.handler

  base.Abort.toOptional.handler : Request {Abort} a -> Optional a
  base.Abort.toOptional.handler = cases
    { a }        -> Some a
    {abort -> _} -> None

base.Ask

.> view base.Ask

  ability base.Ask a where ask : {base.Ask a} a

base.Ask.ask

.> view base.Ask.ask

  ability base.Ask a where ask : {base.Ask a} a

base.Ask.provide

.> view base.Ask.provide

  base.Ask.provide : a -> '{g, Ask a} r ->{g} r
  base.Ask.provide a asker =
    handle !asker with provide.handler a

base.Ask.provide.handler

.> view base.Ask.provide.handler

  base.Ask.provide.handler : a -> Request {Ask a} r -> r
  base.Ask.provide.handler a =
    h = cases
      { r }           -> r
      {ask -> resume} -> handle resume a with h
    h

base.Ask.tests.ex1

.> view base.Ask.tests.ex1

  base.Ask.tests.ex1 : [Result]
  base.Ask.tests.ex1 =
    use Nat +
    check (provide 10 '(1 + ask + ask) == 21)

base.Author

.> view base.Author

  unique type base.Author = Author GUID Text

base.Author.Author

.> view base.Author.Author

  unique type base.Author = Author GUID Text

base.Author.guid

.> view base.Author.guid

  base.Author.guid : Author -> GUID
  base.Author.guid = cases Author guid _ -> guid

base.Author.guid.modify

.> view base.Author.guid.modify

  base.Author.guid.modify :
    (GUID ->{𝕖} GUID) -> Author ->{𝕖} Author
  base.Author.guid.modify f = cases
    Author guid name -> Author (f guid) name

base.Author.guid.set

.> view base.Author.guid.set

  base.Author.guid.set : GUID -> Author -> Author
  base.Author.guid.set guid1 = cases
    Author _ name -> Author guid1 name

base.Author.name

.> view base.Author.name

  base.Author.name : Author -> Text
  base.Author.name = cases Author _ name -> name

base.Author.name.modify

.> view base.Author.name.modify

  base.Author.name.modify :
    (Text ->{𝕖} Text) -> Author ->{𝕖} Author
  base.Author.name.modify f = cases
    Author guid name -> Author guid (f name)

base.Author.name.set

.> view base.Author.name.set

  base.Author.name.set : Text -> Author -> Author
  base.Author.name.set name1 = cases
    Author guid _ -> Author guid name1

base.Author.toCopyrightHolder

.> view base.Author.toCopyrightHolder

  base.Author.toCopyrightHolder : Author -> CopyrightHolder
  base.Author.toCopyrightHolder = cases
    Author guid name -> CopyrightHolder guid name

base.Boolean

.> view base.Boolean

  -- base.Boolean is built-in.

base.Boolean.and

.> view base.Boolean.and

  base.Boolean.and : Boolean -> Boolean -> Boolean
  base.Boolean.and x y = x && y

base.Boolean.given

.> view base.Boolean.given

  base.Boolean.given : Boolean -> Boolean -> Boolean
  base.Boolean.given a b = implies b a

base.Boolean.given.test

.> view base.Boolean.given.test

  base.Boolean.given.test : [Result]
  base.Boolean.given.test =
    run
      (tests
        [ check' (given false false == true),
          check' (given false true == false),
          check' (given true false == true),
          check' (given true true == true) ])

base.Boolean.implies

.> view base.Boolean.implies

  base.Boolean.implies : Boolean -> Boolean -> Boolean
  base.Boolean.implies a b = (not a) || b

base.Boolean.implies.test

.> view base.Boolean.implies.test

  base.Boolean.implies.test : [Result]
  base.Boolean.implies.test =
    run
      (tests
        [ check' (implies false false == true),
          check' (implies false true == true),
          check' (implies true false == false),
          check' (implies true true == true) ])

base.Boolean.not

.> view base.Boolean.not

  -- base.Boolean.not is built-in.

base.Boolean.or

.> view base.Boolean.or

  base.Boolean.or : Boolean -> Boolean -> Boolean
  base.Boolean.or x y = x || y

base.Boolean.xor

.> view base.Boolean.xor

  base.Boolean.xor : Boolean -> Boolean -> Boolean
  base.Boolean.xor x y = (x || y) && (not (x && y))

base.Boolean.xor.test

.> view base.Boolean.xor.test

  base.Boolean.xor.test : [Result]
  base.Boolean.xor.test =
    use Boolean xor
    run
      (tests
        [ check' (xor false false == false),
          check' (xor false true == true),
          check' (xor true false == true),
          check' (xor true true == false) ])

base.Bytes

.> view base.Bytes

  -- base.Bytes is built-in.

base.Bytes.++

.> view base.Bytes.++

  -- base.Bytes.++ is built-in.

base.Bytes.at

.> view base.Bytes.at

  -- base.Bytes.at is built-in.

base.Bytes.drop

.> view base.Bytes.drop

  -- base.Bytes.drop is built-in.

base.Bytes.empty

.> view base.Bytes.empty

  -- base.Bytes.empty is built-in.

base.Bytes.flatten

.> view base.Bytes.flatten

  -- base.Bytes.flatten is built-in.

base.Bytes.fromList

.> view base.Bytes.fromList

  -- base.Bytes.fromList is built-in.

base.Bytes.size

.> view base.Bytes.size

  -- base.Bytes.size is built-in.

base.Bytes.take

.> view base.Bytes.take

  -- base.Bytes.take is built-in.

base.Bytes.toList

.> view base.Bytes.toList

  -- base.Bytes.toList is built-in.

base.Char

.> view base.Char

  -- base.Char is built-in.

base.Char.ascii.isAlphaNum

.> view base.Char.ascii.isAlphaNum

  base.Char.ascii.isAlphaNum : Char -> Boolean
  base.Char.ascii.isAlphaNum c = (isLetter c) || (isDigit c)

base.Char.ascii.isAscii

.> view base.Char.ascii.isAscii

  base.Char.ascii.isAscii : Char -> Boolean
  base.Char.ascii.isAscii c = toNat c < 128

base.Char.ascii.isBlank

.> view base.Char.ascii.isBlank

  base.Char.ascii.isBlank : Char -> Boolean
  base.Char.ascii.isBlank = cases
    ?\s -> true
    ?\t -> true
    _   -> false

base.Char.ascii.isControl

.> view base.Char.ascii.isControl

  base.Char.ascii.isControl : Char -> Boolean
  base.Char.ascii.isControl c = Nat.lt (toNat c) (toNat ?\s)

base.Char.ascii.isDigit

.> view base.Char.ascii.isDigit

  base.Char.ascii.isDigit : Char -> Boolean
  base.Char.ascii.isDigit = Char.inRange ?0 ?9

base.Char.ascii.isGraph

.> view base.Char.ascii.isGraph

  base.Char.ascii.isGraph : Char -> Boolean
  base.Char.ascii.isGraph c =
    if c == ?\s then false else isPrint c

base.Char.ascii.isHexDigit

.> view base.Char.ascii.isHexDigit

  base.Char.ascii.isHexDigit : Char -> Boolean
  base.Char.ascii.isHexDigit c =
    use Char inRange
    (isDigit c) || ((inRange ?a ?f c) || (inRange ?A ?F c))

base.Char.ascii.isLetter

.> view base.Char.ascii.isLetter

  base.Char.ascii.isLetter : Char -> Boolean
  base.Char.ascii.isLetter c = (isLower c) || (isUpper c)

base.Char.ascii.isLower

.> view base.Char.ascii.isLower

  base.Char.ascii.isLower : Char -> Boolean
  base.Char.ascii.isLower = Char.inRange ?a ?z

base.Char.ascii.isPrint

.> view base.Char.ascii.isPrint

  base.Char.ascii.isPrint : Char -> Boolean
  base.Char.ascii.isPrint = Char.inRange ?\s ?~

base.Char.ascii.isPunct

.> view base.Char.ascii.isPunct

  base.Char.ascii.isPunct : Char -> Boolean
  base.Char.ascii.isPunct c =
    if (c == ?\s) || (isAlphaNum c) then false else isPrint c

base.Char.ascii.isSpace

.> view base.Char.ascii.isSpace

  base.Char.ascii.isSpace : Char -> Boolean
  base.Char.ascii.isSpace = cases
    ?\s -> true
    ?\f -> true
    ?\n -> true
    ?\r -> true
    ?\t -> true
    ?\v -> true
    _   -> false

base.Char.ascii.isUpper

.> view base.Char.ascii.isUpper

  base.Char.ascii.isUpper : Char -> Boolean
  base.Char.ascii.isUpper = Char.inRange ?A ?Z

base.Char.ascii.lowerUpperDiff

.> view base.Char.ascii.lowerUpperDiff

  base.Char.ascii.lowerUpperDiff : Int
  base.Char.ascii.lowerUpperDiff =
    use Int -
    toInt (toNat ?a) - toInt (toNat ?A)

base.Char.ascii.tests.propUpperLower

.> view base.Char.ascii.tests.propUpperLower

  base.Char.ascii.tests.propUpperLower : [Result]
  base.Char.ascii.tests.propUpperLower =
    go _ =
      use ascii toLower toUpper
      c = fromNat !nat
      if isUpper c then expect (toUpper (toLower c) == c)
      else
        if isLower c then expect (toLower (toUpper c) == c)
        else expect ((toUpper c == c) && (toLower c == c))
    runs 128 go

base.Char.ascii.tests.toLower

.> view base.Char.ascii.tests.toLower

  base.Char.ascii.tests.toLower : [Result]
  base.Char.ascii.tests.toLower = check (ascii.toLower ?A == ?a)

base.Char.ascii.tests.toUpper

.> view base.Char.ascii.tests.toUpper

  base.Char.ascii.tests.toUpper : [Result]
  base.Char.ascii.tests.toUpper = check (ascii.toUpper ?a == ?A)

base.Char.ascii.toLower

.> view base.Char.ascii.toLower

  base.Char.ascii.toLower : Char -> Char
  base.Char.ascii.toLower c =
    if isUpper c then
      use Int +
      fromNat (truncate0 (toInt (toNat c) + lowerUpperDiff))
    else c

base.Char.ascii.toUpper

.> view base.Char.ascii.toUpper

  base.Char.ascii.toUpper : Char -> Char
  base.Char.ascii.toUpper c =
    if isLower c then
      use Int -
      fromNat (truncate0 (toInt (toNat c) - lowerUpperDiff))
    else c

base.Char.fromNat

.> view base.Char.fromNat

  -- base.Char.fromNat is built-in.

base.Char.inRange

.> view base.Char.inRange

  base.Char.inRange : Char -> Char -> Char -> Boolean
  base.Char.inRange lo hi c =
    code = toNat c
    (toNat lo <= code) && (code <= toNat hi)

base.Char.toNat

.> view base.Char.toNat

  -- base.Char.toNat is built-in.

base.CopyrightHolder

.> view base.CopyrightHolder

  unique type base.CopyrightHolder = CopyrightHolder GUID Text

base.CopyrightHolder.CopyrightHolder

.> view base.CopyrightHolder.CopyrightHolder

  unique type base.CopyrightHolder = CopyrightHolder GUID Text

base.CopyrightHolder.guid

.> view base.CopyrightHolder.guid

  base.CopyrightHolder.guid : CopyrightHolder -> GUID
  base.CopyrightHolder.guid = cases
    CopyrightHolder guid _ -> guid

base.CopyrightHolder.guid.modify

.> view base.CopyrightHolder.guid.modify

  base.CopyrightHolder.guid.modify :
    (GUID ->{𝕖} GUID) -> CopyrightHolder ->{𝕖} CopyrightHolder
  base.CopyrightHolder.guid.modify f = cases
    CopyrightHolder guid name -> CopyrightHolder (f guid) name

base.CopyrightHolder.guid.set

.> view base.CopyrightHolder.guid.set

  base.CopyrightHolder.guid.set :
    GUID -> CopyrightHolder -> CopyrightHolder
  base.CopyrightHolder.guid.set guid1 = cases
    CopyrightHolder _ name -> CopyrightHolder guid1 name

base.CopyrightHolder.name

.> view base.CopyrightHolder.name

  base.CopyrightHolder.name : CopyrightHolder -> Text
  base.CopyrightHolder.name = cases
    CopyrightHolder _ name -> name

base.CopyrightHolder.name.modify

.> view base.CopyrightHolder.name.modify

  base.CopyrightHolder.name.modify :
    (Text ->{𝕖} Text) -> CopyrightHolder ->{𝕖} CopyrightHolder
  base.CopyrightHolder.name.modify f = cases
    CopyrightHolder guid name -> CopyrightHolder guid (f name)

base.CopyrightHolder.name.set

.> view base.CopyrightHolder.name.set

  base.CopyrightHolder.name.set :
    Text -> CopyrightHolder -> CopyrightHolder
  base.CopyrightHolder.name.set name1 = cases
    CopyrightHolder guid _ -> CopyrightHolder guid name1

base.Debug.watch

.> view base.Debug.watch

  -- base.Debug.watch is built-in.

base.Doc

.> view base.Doc

  unique type base.Doc
    = Link Link
    | Source Link
    | Blob Text
    | Join [base.Doc]
    | Signature Term
    | Evaluate Term

base.Doc.++

.> view base.Doc.++

  (base.Doc.++) : Doc -> Doc -> Doc
  d1 base.Doc.++ d2 =
    match (d1, d2) with
      (Join ds, Join ds2) ->
        use List ++
        Join (ds ++ ds2)
      (Join ds, _)        -> Join (ds :+ d2)
      (_, Join ds)        -> Join (d1 +: ds)
      _                   -> Join [d1, d2]

base.Doc.Blob

.> view base.Doc.Blob

  unique type base.Doc
    = Link Link
    | Source Link
    | Blob Text
    | Join [base.Doc]
    | Signature Term
    | Evaluate Term

base.Doc.Evaluate

.> view base.Doc.Evaluate

  unique type base.Doc
    = Link Link
    | Source Link
    | Blob Text
    | Join [base.Doc]
    | Signature Term
    | Evaluate Term

base.Doc.Join

.> view base.Doc.Join

  unique type base.Doc
    = Link Link
    | Source Link
    | Blob Text
    | Join [base.Doc]
    | Signature Term
    | Evaluate Term

base.Doc.Link

.> view base.Doc.Link

  unique type base.Doc
    = Link Link
    | Source Link
    | Blob Text
    | Join [base.Doc]
    | Signature Term
    | Evaluate Term

base.Doc.Signature

.> view base.Doc.Signature

  unique type base.Doc
    = Link Link
    | Source Link
    | Blob Text
    | Join [base.Doc]
    | Signature Term
    | Evaluate Term

base.Doc.Source

.> view base.Doc.Source

  unique type base.Doc
    = Link Link
    | Source Link
    | Blob Text
    | Join [base.Doc]
    | Signature Term
    | Evaluate Term

base.Doc.example

.> view base.Doc.example

  base.Doc.example : Term -> Doc
  base.Doc.example e =
    source = Source (Term e)
    value = Evaluate e
    Join
      [Blob "\n", source, Blob "\n\nOutput: ", value, Blob ""]

base.Either

.> view base.Either

  type base.Either a b = Left a | Right b

base.Either.Left

.> view base.Either.Left

  type base.Either a b = Left a | Right b

base.Either.Right

.> view base.Either.Right

  type base.Either a b = Left a | Right b

base.Either.mapLeft

.> view base.Either.mapLeft

  base.Either.mapLeft : (a ->{𝕖} b) -> Either a z ->{𝕖} Either b z
  base.Either.mapLeft f = cases
    Left l  -> Left (f l)
    Right r -> Right r

base.Either.mapLeft.tests.ex1

.> view base.Either.mapLeft.tests.ex1

  base.Either.mapLeft.tests.ex1 : [Result]
  base.Either.mapLeft.tests.ex1 =
    check
      let
        input = [Left 2, Left 5, Right "Hiya"]
        actual = List.map (mapLeft Nat.toText) input
        expected = [Left "2", Left "5", Right "Hiya"]
        assert
          (actual == expected)
          ("Not equal!", actual, expected)
          true

base.Either.mapRight

.> view base.Either.mapRight

  base.Either.mapRight :
    (a ->{𝕖} b) -> Either e a ->{𝕖} Either e b
  base.Either.mapRight f = cases
    Left l  -> Left l
    Right a -> Right (f a)

base.Either.mapRight.tests.ex1

.> view base.Either.mapRight.tests.ex1

  base.Either.mapRight.tests.ex1 : [Result]
  base.Either.mapRight.tests.ex1 =
    check
      let
        input =
          [Left 2, Left 5, Right "Hiya", Right "Bye", Left 10]
        actual =
          use Text ++
          List.map (mapRight (s -> s ++ "!")) input
        expected =
          [Left 2, Left 5, Right "Hiya!", Right "Bye!", Left 10]
        assert
          (actual == expected)
          ("Not equal!", actual, expected)
          true

base.Either.toException

.> view base.Either.toException

  base.Either.toException : Either e a ->{Exception e} a
  base.Either.toException = cases
    Left e  -> raise e
    Right a -> a

base.Exception

.> view base.Exception

  ability base.Exception e where
    raise : e ->{base.Exception e} a

base.Exception.raise

.> view base.Exception.raise

  ability base.Exception e where
    raise : e ->{base.Exception e} a

base.Exception.tests.ex1

.> view base.Exception.tests.ex1

  base.Exception.tests.ex1 : [Result]
  base.Exception.tests.ex1 =
    check (toEither '(raise 42) == Left 42)

base.Exception.tests.ex2

.> view base.Exception.tests.ex2

  base.Exception.tests.ex2 : [Result]
  base.Exception.tests.ex2 =
    use Nat +
    check (toEither '(1 + raise 42) == Left 42)

base.Exception.tests.ex3

.> view base.Exception.tests.ex3

  base.Exception.tests.ex3 : [Result]
  base.Exception.tests.ex3 =
    use Nat +
    check (toEither '(toException (Right 1) + 42) == Right 43)

base.Exception.toEither

.> view base.Exception.toEither

  base.Exception.toEither : '{g, Exception e} a ->{g} Either e a
  base.Exception.toEither a = handle !a with toEither.handler

base.Exception.toEither.handler

.> view base.Exception.toEither.handler

  base.Exception.toEither.handler :
    Request {Exception e} a -> Either e a
  base.Exception.toEither.handler = cases
    { a }          -> Right a
    {raise e -> _} -> Left e

base.Float

.> view base.Float

  -- base.Float is built-in.

base.Float.*

.> view base.Float.*

  -- base.Float.* is built-in.

base.Float.+

.> view base.Float.+

  -- base.Float.+ is built-in.

base.Float.-

.> view base.Float.-

  -- base.Float.- is built-in.

base.Float./

.> view base.Float./

  -- base.Float./ is built-in.

base.Float.abs

.> view base.Float.abs

  -- base.Float.abs is built-in.

base.Float.acos

.> view base.Float.acos

  -- base.Float.acos is built-in.

base.Float.acosh

.> view base.Float.acosh

  -- base.Float.acosh is built-in.

base.Float.asin

.> view base.Float.asin

  -- base.Float.asin is built-in.

base.Float.asinh

.> view base.Float.asinh

  -- base.Float.asinh is built-in.

base.Float.atan

.> view base.Float.atan

  -- base.Float.atan is built-in.

base.Float.atan2

.> view base.Float.atan2

  -- base.Float.atan2 is built-in.

base.Float.atanh

.> view base.Float.atanh

  -- base.Float.atanh is built-in.

base.Float.ceiling

.> view base.Float.ceiling

  -- base.Float.ceiling is built-in.

base.Float.cos

.> view base.Float.cos

  -- base.Float.cos is built-in.

base.Float.cosh

.> view base.Float.cosh

  -- base.Float.cosh is built-in.

base.Float.eq

.> view base.Float.eq

  -- base.Float.eq is built-in.

base.Float.exp

.> view base.Float.exp

  -- base.Float.exp is built-in.

base.Float.floor

.> view base.Float.floor

  -- base.Float.floor is built-in.

base.Float.fromText

.> view base.Float.fromText

  -- base.Float.fromText is built-in.

base.Float.gt

.> view base.Float.gt

  -- base.Float.gt is built-in.

base.Float.gteq

.> view base.Float.gteq

  -- base.Float.gteq is built-in.

base.Float.log

.> view base.Float.log

  -- base.Float.log is built-in.

base.Float.logBase

.> view base.Float.logBase

  -- base.Float.logBase is built-in.

base.Float.lt

.> view base.Float.lt

  -- base.Float.lt is built-in.

base.Float.lteq

.> view base.Float.lteq

  -- base.Float.lteq is built-in.

base.Float.max

.> view base.Float.max

  -- base.Float.max is built-in.

base.Float.min

.> view base.Float.min

  -- base.Float.min is built-in.

base.Float.pow

.> view base.Float.pow

  -- base.Float.pow is built-in.

base.Float.round

.> view base.Float.round

  -- base.Float.round is built-in.

base.Float.sin

.> view base.Float.sin

  -- base.Float.sin is built-in.

base.Float.sinh

.> view base.Float.sinh

  -- base.Float.sinh is built-in.

base.Float.sqrt

.> view base.Float.sqrt

  -- base.Float.sqrt is built-in.

base.Float.tan

.> view base.Float.tan

  -- base.Float.tan is built-in.

base.Float.tanh

.> view base.Float.tanh

  -- base.Float.tanh is built-in.

base.Float.toText

.> view base.Float.toText

  -- base.Float.toText is built-in.

base.Float.truncate

.> view base.Float.truncate

  -- base.Float.truncate is built-in.

base.Function.curry

.> view base.Function.curry

  base.Function.curry : ((a, b) ->{e} c) -> a -> b ->{e} c
  base.Function.curry f a b = f (a, b)

base.Function.fix

.> view base.Function.fix

  base.Function.fix : ('{e} a ->{e} a) ->{e} a
  base.Function.fix f =
    x = '(f x)
    !x

base.Function.fix.examples.factorial.explicitRecursion

.> view base.Function.fix.examples.factorial.explicitRecursion

  base.Function.fix.examples.factorial.explicitRecursion : Nat
  base.Function.fix.examples.factorial.explicitRecursion =
    fac n =
      if n <= 1 then 1
      else
        use Nat *
        n * fac (Nat.decrement n)
    fac 7

base.Function.fix.examples.factorial.fixpoint

.> view base.Function.fix.examples.factorial.fixpoint

  base.Function.fix.examples.factorial.fixpoint : Nat
  base.Function.fix.examples.factorial.fixpoint =
    fix
      (rec n ->
        (if n <= 1 then 1
        else
          use Nat *
          n * !rec (Nat.decrement n))) 7

base.Function.flatMap

.> view base.Function.flatMap

  base.Function.flatMap :
    (a -> r ->{e} b) -> (r ->{e} a) -> r ->{e} b
  base.Function.flatMap f x r = f (x r) r

base.Function.flip

.> view base.Function.flip

  base.Function.flip : (a ->{e} b ->{e} c) -> b -> a ->{e} c
  base.Function.flip f b a = f a b

base.Function.on

.> view base.Function.on

  base.Function.on :
    (b ->{e} b ->{e} c) -> (a ->{e} b) -> a -> a ->{e} c
  base.Function.on b u x y = b (u x) (u y)

base.Function.on.examples.equalOn

.> view base.Function.on.examples.equalOn

  base.Function.on.examples.equalOn : Boolean
  base.Function.on.examples.equalOn =
    on (==) List.size [1, 2, 3] [5, 5, 5]

base.Function.uncurry

.> view base.Function.uncurry

  base.Function.uncurry : (a ->{e} b ->{e} c) -> (a, b) ->{e} c
  base.Function.uncurry f = cases (a, b) -> f a b

base.GUID

.> view base.GUID

  unique type base.GUID = GUID Bytes

base.GUID.GUID

.> view base.GUID.GUID

  unique type base.GUID = GUID Bytes

base.Heap

.> view base.Heap

  type base.Heap k v = Heap Nat k v [base.Heap k v]

base.Heap.Heap

.> view base.Heap.Heap

  type base.Heap k v = Heap Nat k v [base.Heap k v]

base.Heap.children

.> view base.Heap.children

  base.Heap.children : Heap k v -> [Heap k v]
  base.Heap.children = cases Heap _ _ _ cs -> cs

base.Heap.fromKeys

.> view base.Heap.fromKeys

  base.Heap.fromKeys : [a] -> Optional (Heap a a)
  base.Heap.fromKeys as =
    Heap.fromList (List.map (a -> (a, a)) as)

base.Heap.fromList

.> view base.Heap.fromList

  base.Heap.fromList : [(k, v)] -> Optional (Heap k v)
  base.Heap.fromList kvs =
    op a b =
      match a with
        None   -> b
        Some a ->
          match b with
            None   -> Some a
            Some b -> Some (Heap.union a b)
    single = cases (k, v) -> Some (Heap.singleton k v)
    foldb single op None kvs

base.Heap.max

.> view base.Heap.max

  base.Heap.max : Heap k v -> (k, v)
  base.Heap.max = cases Heap _ k v _ -> (k, v)

base.Heap.maxKey

.> view base.Heap.maxKey

  base.Heap.maxKey : Heap k v -> k
  base.Heap.maxKey = cases Heap _ k _ _ -> k

base.Heap.pop

.> view base.Heap.pop

  base.Heap.pop : Heap k v -> Optional (Heap k v)
  base.Heap.pop h =
    go h subs =
      use List size
      if size subs == 0 then h
      else
        use Heap union
        if size subs == 1 then union h (unsafeAt 0 subs)
        else
          union
            (union h (unsafeAt 0 subs))
            (go (unsafeAt 1 subs) (List.drop 2 subs))
    match List.uncons (children h) with
      None            -> None
      Some (s0, subs) -> Some (go s0 subs)

base.Heap.singleton

.> view base.Heap.singleton

  base.Heap.singleton : k -> v -> Heap k v
  base.Heap.singleton k v = Heap 1 k v []

base.Heap.size

.> view base.Heap.size

  base.Heap.size : Heap k v -> Nat
  base.Heap.size = cases Heap n _ _ _ -> n

base.Heap.sort

.> view base.Heap.sort

  base.Heap.sort : [a] -> [a]
  base.Heap.sort as = sortDescending as |> reverse

base.Heap.sortDescending

.> view base.Heap.sortDescending

  base.Heap.sortDescending : [a] -> [a]
  base.Heap.sortDescending as =
    step = cases
      None   -> None
      Some h -> Some (Heap.max h, pop h)
    unfold (fromKeys as) step |> List.map at1

base.Heap.union

.> view base.Heap.union

  base.Heap.union : Heap k v -> Heap k v -> Heap k v
  base.Heap.union h1 h2 =
    match (h1, h2) with
      (Heap n k1 v1 hs1, Heap m k2 v2 hs2) ->
        use Nat +
        if k1 >= k2 then Heap (n + m) k1 v1 (h2 +: hs1)
        else Heap (n + m) k2 v2 (h1 +: hs2)

base.Int

.> view base.Int

  -- base.Int is built-in.

base.Int.*

.> view base.Int.*

  -- base.Int.* is built-in.

base.Int.+

.> view base.Int.+

  -- base.Int.+ is built-in.

base.Int.-

.> view base.Int.-

  -- base.Int.- is built-in.

base.Int./

.> view base.Int./

  -- base.Int./ is built-in.

base.Int.and

.> view base.Int.and

  -- base.Int.and is built-in.

base.Int.complement

.> view base.Int.complement

  -- base.Int.complement is built-in.

base.Int.decrement

.> view base.Int.decrement

  base.Int.decrement : Int -> Int
  base.Int.decrement n =
    use Int -
    n - +1

base.Int.decrement.test

.> view base.Int.decrement.test

  base.Int.decrement.test : [Result]
  base.Int.decrement.test =
    use Int +
    forAll 100 Domain.ints (n -> Int.decrement n + +1 == n)

base.Int.eq

.> view base.Int.eq

  -- base.Int.eq is built-in.

base.Int.fromText

.> view base.Int.fromText

  -- base.Int.fromText is built-in.

base.Int.gt

.> view base.Int.gt

  -- base.Int.gt is built-in.

base.Int.gteq

.> view base.Int.gteq

  -- base.Int.gteq is built-in.

base.Int.inRange

.> view base.Int.inRange

  base.Int.inRange : Int -> Int -> Int -> Boolean
  base.Int.inRange fromInclusive toExclusive x =
    (x >= fromInclusive) && (x < toExclusive)

base.Int.inRange.test

.> view base.Int.inRange.test

  base.Int.inRange.test : [Result]
  base.Int.inRange.test =
    runs
      100
      'let
        x = !int
        y = !int
        z = !int
        match sort [x, y, z] with
          [x, y, z] -> expect ((Int.inRange x z y) || (z == y))

base.Int.increment

.> view base.Int.increment

  -- base.Int.increment is built-in.

base.Int.isEven

.> view base.Int.isEven

  -- base.Int.isEven is built-in.

base.Int.isOdd

.> view base.Int.isOdd

  -- base.Int.isOdd is built-in.

base.Int.leadingZeros

.> view base.Int.leadingZeros

  -- base.Int.leadingZeros is built-in.

base.Int.lt

.> view base.Int.lt

  -- base.Int.lt is built-in.

base.Int.lteq

.> view base.Int.lteq

  -- base.Int.lteq is built-in.

base.Int.maxInt

.> view base.Int.maxInt

  base.Int.maxInt : Int
  base.Int.maxInt = +9223372036854775807

base.Int.minInt

.> view base.Int.minInt

  base.Int.minInt : Int
  base.Int.minInt = -9223372036854775808

base.Int.mod

.> view base.Int.mod

  -- base.Int.mod is built-in.

base.Int.negate

.> view base.Int.negate

  -- base.Int.negate is built-in.

base.Int.or

.> view base.Int.or

  -- base.Int.or is built-in.

base.Int.pow

.> view base.Int.pow

  -- base.Int.pow is built-in.

base.Int.range

.> view base.Int.range

  base.Int.range : Int -> Int -> [Int]
  base.Int.range start stopExclusive =
    f : Int -> Optional (Int, Int)
    f i =
      if i < stopExclusive then
        use Int +
        Some (i, i + +1)
      else None
    unfold start f

base.Int.shiftLeft

.> view base.Int.shiftLeft

  -- base.Int.shiftLeft is built-in.

base.Int.shiftRight

.> view base.Int.shiftRight

  -- base.Int.shiftRight is built-in.

base.Int.signum

.> view base.Int.signum

  -- base.Int.signum is built-in.

base.Int.toFloat

.> view base.Int.toFloat

  -- base.Int.toFloat is built-in.

base.Int.toText

.> view base.Int.toText

  -- base.Int.toText is built-in.

base.Int.trailingZeros

.> view base.Int.trailingZeros

  -- base.Int.trailingZeros is built-in.

base.Int.truncate0

.> view base.Int.truncate0

  -- base.Int.truncate0 is built-in.

base.Int.xor

.> view base.Int.xor

  -- base.Int.xor is built-in.

base.IsPropagated

.> view base.IsPropagated

  unique type base.IsPropagated = IsPropagated

base.IsPropagated.IsPropagated

.> view base.IsPropagated.IsPropagated

  unique type base.IsPropagated = IsPropagated

base.IsTest

.> view base.IsTest

  unique type base.IsTest = IsTest

base.IsTest.IsTest

.> view base.IsTest.IsTest

  unique type base.IsTest = IsTest

base.License

.> view base.License

  unique type base.License
    = License [CopyrightHolder] [Year] LicenseType

base.License.License

.> view base.License.License

  unique type base.License
    = License [CopyrightHolder] [Year] LicenseType

base.License.copyrightHolders

.> view base.License.copyrightHolders

  base.License.copyrightHolders : License -> [CopyrightHolder]
  base.License.copyrightHolders = cases
    License copyrightHolders _ _ -> copyrightHolders

base.License.copyrightHolders.modify

.> view base.License.copyrightHolders.modify

  base.License.copyrightHolders.modify :
    ([CopyrightHolder] ->{𝕖} [CopyrightHolder])
    -> License
    ->{𝕖} License
  base.License.copyrightHolders.modify f = cases
    License copyrightHolders years licenseType ->
      License (f copyrightHolders) years licenseType

base.License.copyrightHolders.set

.> view base.License.copyrightHolders.set

  base.License.copyrightHolders.set :
    [CopyrightHolder] -> License -> License
  base.License.copyrightHolders.set copyrightHolders1 = cases
    License _ years licenseType ->
      License copyrightHolders1 years licenseType

base.License.licenseType

.> view base.License.licenseType

  base.License.licenseType : License -> LicenseType
  base.License.licenseType = cases
    License _ _ licenseType -> licenseType

base.License.licenseType.modify

.> view base.License.licenseType.modify

  base.License.licenseType.modify :
    (LicenseType ->{𝕖} LicenseType) -> License ->{𝕖} License
  base.License.licenseType.modify f = cases
    License copyrightHolders years licenseType ->
      License copyrightHolders years (f licenseType)

base.License.licenseType.set

.> view base.License.licenseType.set

  base.License.licenseType.set :
    LicenseType -> License -> License
  base.License.licenseType.set licenseType1 = cases
    License copyrightHolders years _ ->
      License copyrightHolders years licenseType1

base.License.years

.> view base.License.years

  base.License.years : License -> [Year]
  base.License.years = cases License _ years _ -> years

base.License.years.modify

.> view base.License.years.modify

  base.License.years.modify :
    ([Year] ->{𝕖} [Year]) -> License ->{𝕖} License
  base.License.years.modify f = cases
    License copyrightHolders years licenseType ->
      License copyrightHolders (f years) licenseType

base.License.years.set

.> view base.License.years.set

  base.License.years.set : [Year] -> License -> License
  base.License.years.set years1 = cases
    License copyrightHolders _ licenseType ->
      License copyrightHolders years1 licenseType

base.LicenseType

.> view base.LicenseType

  unique type base.LicenseType = LicenseType Doc

base.LicenseType.LicenseType

.> view base.LicenseType.LicenseType

  unique type base.LicenseType = LicenseType Doc

base.Link

.> view base.Link

  unique type base.Link = Term Term | Type Type

base.Link.Term

.> view base.Link.Term

  unique type base.Link = Term Term | Type Type
  
  -- base.Link.Term is built-in.

base.Link.Term

.> view base.Link.Term

  unique type base.Link = Term Term | Type Type
  
  -- base.Link.Term is built-in.

base.Link.Type

.> view base.Link.Type

  unique type base.Link = Term Term | Type Type
  
  -- base.Link.Type is built-in.

base.Link.Type

.> view base.Link.Type

  unique type base.Link = Term Term | Type Type
  
  -- base.Link.Type is built-in.

base.List

.> view base.List

  -- base.List is built-in.

base.List.++

.> view base.List.++

  -- base.List.++ is built-in.

base.List.+:

.> view base.List.+:

  -- base.List.+: is built-in.

base.List.:+

.> view base.List.:+

  -- base.List.:+ is built-in.

base.List.Nonempty

.> view base.List.Nonempty

  type base.List.Nonempty a = Nonempty a [a]

base.List.Nonempty.++

.> view base.List.Nonempty.++

  (base.List.Nonempty.++) : Nonempty a -> Nonempty a -> Nonempty a
  (base.List.Nonempty.++) = cases
    Nonempty x xs ->
      cases
        Nonempty y ys ->
          use List ++
          Nonempty x (xs :+ y ++ ys)

base.List.Nonempty.+|

.> view base.List.Nonempty.+|

  (base.List.Nonempty.+|) : a -> [a] -> Nonempty a
  (base.List.Nonempty.+|) = Nonempty

base.List.Nonempty.Nonempty

.> view base.List.Nonempty.Nonempty

  type base.List.Nonempty a = Nonempty a [a]

base.List.Nonempty.append

.> view base.List.Nonempty.append

  (base.List.Nonempty.++) : Nonempty a -> Nonempty a -> Nonempty a
  (base.List.Nonempty.++) = cases
    Nonempty x xs ->
      cases
        Nonempty y ys ->
          use List ++
          Nonempty x (xs :+ y ++ ys)

base.List.Nonempty.append.tests.associative

.> view base.List.Nonempty.append.tests.associative

  base.List.Nonempty.append.tests.associative : [Result]
  base.List.Nonempty.append.tests.associative =
    use Nonempty ++
    runs
      100 'let
        x = !(atLeastOne nat)
        y = !(atLeastOne nat)
        z = !(atLeastOne nat)
        expect (x ++ (y ++ z) == (x ++ y ++ z))

base.List.Nonempty.append.tests.homomorphism

.> view base.List.Nonempty.append.tests.homomorphism

  base.List.Nonempty.append.tests.homomorphism : [Result]
  base.List.Nonempty.append.tests.homomorphism =
    use List size
    use Nat +
    use Nonempty ++ toList
    runs
      100
      'let
        x = !(atLeastOne nat)
        y = !(atLeastOne nat)
        expect
          (   size (toList x)
          +  size (toList y)
          == size (toList (x ++ y)))

base.List.Nonempty.cons

.> view base.List.Nonempty.cons

  base.List.Nonempty.cons : a -> Nonempty a -> Nonempty a
  base.List.Nonempty.cons a =  (Nonempty a) Nonempty.toList

base.List.Nonempty.examples.construction.ex1

.> view base.List.Nonempty.examples.construction.ex1

  base.List.Nonempty.examples.construction.ex1 : Nonempty Nat
  base.List.Nonempty.examples.construction.ex1 =
    Nonempty 1 [2, 3]

base.List.Nonempty.examples.construction.ex2

.> view base.List.Nonempty.examples.construction.ex2

  base.List.Nonempty.examples.construction.ex2 :
    Optional (Nonempty Nat)
  base.List.Nonempty.examples.construction.ex2 =
    nonempty [1, 2, 3]

base.List.Nonempty.flatMap

.> view base.List.Nonempty.flatMap

  base.List.Nonempty.flatMap :
    (a ->{e} Nonempty b) -> Nonempty a ->{e} Nonempty b
  base.List.Nonempty.flatMap f = cases
    Nonempty a as ->
      match List.flatMap ( Nonempty.toList f) as with
        x +: xs ->
          use Nonempty ++
          f a ++ Nonempty x xs
        []      -> f a

base.List.Nonempty.flatMap.tests.flatMapIdIsjoin

.> view base.List.Nonempty.flatMap.tests.flatMapIdIsjoin

  base.List.Nonempty.flatMap.tests.flatMapIdIsjoin : [Result]
  base.List.Nonempty.flatMap.tests.flatMapIdIsjoin =
    runs
      100 'let
        xs = !(atLeastOne (atLeastOne nat))
        expect (Nonempty.flatMap id xs == Nonempty.join xs)

base.List.Nonempty.foldMap

.> view base.List.Nonempty.foldMap

  base.List.Nonempty.foldMap :
    (b ->{e} b ->{e} b) -> (a ->{e} b) -> Nonempty a ->{e} b
  base.List.Nonempty.foldMap semigroup f = cases
    Nonempty a as ->
      List.foldl (acc x -> semigroup acc (f x)) (f a) as

base.List.Nonempty.foldMap.examples.ex1

.> view base.List.Nonempty.foldMap.examples.ex1

  base.List.Nonempty.foldMap.examples.ex1 : Text
  base.List.Nonempty.foldMap.examples.ex1 =
    use Text ++
    foldMap (++) Nat.toText (1 +| [2, 3])

base.List.Nonempty.foldMap.test

.> view base.List.Nonempty.foldMap.test

  base.List.Nonempty.foldMap.test : [Result]
  base.List.Nonempty.foldMap.test =
    use Nat toText
    use Text ++
    runs
      100
      'let
        x = !nat
        y = !nat
        z = !nat
        f = foldMap (++) toText
        expect
          (((   f (x +| [y, z])
          == (toText x ++ toText y ++ toText z))
          &&
          (f (x +| [y]) == (toText x ++ toText y)))
          &&
          (f (Nonempty.singleton x) == toText x))

base.List.Nonempty.foldl

.> view base.List.Nonempty.foldl

  base.List.Nonempty.foldl :
    (a ->{e} a ->{e} a) -> Nonempty a ->{e} a
  base.List.Nonempty.foldl f = cases
    Nonempty a as -> List.foldl f a as

base.List.Nonempty.foldl.test

.> view base.List.Nonempty.foldl.test

  base.List.Nonempty.foldl.test : [Result]
  base.List.Nonempty.foldl.test =
    use Nat drop
    use Nonempty foldl
    runs
      100
      'let
        x = !nat
        y = !nat
        z = !nat
        expect
          (((foldl drop (x +| [y, z]) == drop (drop x y) z)
          &&
          (foldl drop (x +| [y]) == drop x y))
          &&
          (foldl drop (Nonempty.singleton x) == x))

base.List.Nonempty.foldr

.> view base.List.Nonempty.foldr

  base.List.Nonempty.foldr :
    (a ->{e} a ->{e} a) -> Nonempty a ->{e} a
  base.List.Nonempty.foldr f as =
    List.foldr f (Nonempty.last as) (Nonempty.init as)

base.List.Nonempty.foldr.test

.> view base.List.Nonempty.foldr.test

  base.List.Nonempty.foldr.test : [Result]
  base.List.Nonempty.foldr.test =
    use Nat drop
    use Nonempty foldr
    runs
      100
      'let
        x = !nat
        y = !nat
        z = !nat
        expect
          (((foldr drop (x +| [y, z]) == drop x (drop y z))
          &&
          (foldr drop (x +| [y]) == drop x y))
          &&
          (foldr drop (Nonempty.singleton x) == x))

base.List.Nonempty.head

.> view base.List.Nonempty.head

  base.List.Nonempty.head : Nonempty a -> a
  base.List.Nonempty.head = cases Nonempty a _ -> a

base.List.Nonempty.head.test

.> view base.List.Nonempty.head.test

  base.List.Nonempty.head.test : [Result]
  base.List.Nonempty.head.test =
    runs
      100 'let
        a = !nat
        as = !(listOf nat)
        expect (Nonempty.head (Nonempty a as) == a)

base.List.Nonempty.init

.> view base.List.Nonempty.init

  base.List.Nonempty.init : Nonempty a -> [a]
  base.List.Nonempty.init = cases
    Nonempty a []        -> []
    Nonempty a (xs :+ _) -> a +: xs

base.List.Nonempty.init.test

.> view base.List.Nonempty.init.test

  base.List.Nonempty.init.test : [Result]
  base.List.Nonempty.init.test =
    runs
      100 'let
        a = !nat
        as = !(listOf nat)
        expect (Nonempty.init (as |+ a) == as)

base.List.Nonempty.join

.> view base.List.Nonempty.join

  base.List.Nonempty.join : Nonempty (Nonempty a) -> Nonempty a
  base.List.Nonempty.join = cases
    Nonempty (Nonempty a as) nels ->
      use List ++
      Nonempty a (as ++ List.flatMap Nonempty.toList nels)

base.List.Nonempty.join.examples.ex1

.> view base.List.Nonempty.join.examples.ex1

  base.List.Nonempty.join.examples.ex1 : Nonempty Nat
  base.List.Nonempty.join.examples.ex1 =
    Nonempty.join
      (Nonempty (Nonempty 1 [2]) [Nonempty 3 [4, 5]])

base.List.Nonempty.join.tests.associative

.> view base.List.Nonempty.join.tests.associative

  base.List.Nonempty.join.tests.associative : [Result]
  base.List.Nonempty.join.tests.associative =
    use Nonempty join
    runs
      100
      'let
        nels = !(atLeastOne (atLeastOne (atLeastOne nat)))
        expect
          (join (join nels) == join (Nonempty.map join nels))

base.List.Nonempty.join.tests.unit

.> view base.List.Nonempty.join.tests.unit

  base.List.Nonempty.join.tests.unit : [Result]
  base.List.Nonempty.join.tests.unit =
    use Nonempty join singleton
    runs
      100
      'let
        nats = !(atLeastOne nat)
        right = join (Nonempty.map singleton nats)
        left = join (singleton nats)
        expect
          ((left == right) && (left == nats) == (right == nats))

base.List.Nonempty.last

.> view base.List.Nonempty.last

  base.List.Nonempty.last : Nonempty a -> a
  base.List.Nonempty.last = cases
    Nonempty a []        -> a
    Nonempty a (xs :+ x) -> x

base.List.Nonempty.last.test

.> view base.List.Nonempty.last.test

  base.List.Nonempty.last.test : [Result]
  base.List.Nonempty.last.test =
    runs
      100 'let
        a = !nat
        as = !(listOf nat)
        expect (Nonempty.last (as |+ a) == a)

base.List.Nonempty.map

.> view base.List.Nonempty.map

  base.List.Nonempty.map :
    (a ->{e} b) -> Nonempty a ->{e} Nonempty b
  base.List.Nonempty.map f = cases
    Nonempty a as -> Nonempty (f a) (List.map f as)

base.List.Nonempty.map.tests.functor

.> view base.List.Nonempty.map.tests.functor

  base.List.Nonempty.map.tests.functor : [Result]
  base.List.Nonempty.map.tests.functor =
    runs
      100 'let
        nats = !(atLeastOne nat)
        nats' = Nonempty.map id nats
        expect (nats' == nats)

base.List.Nonempty.scanl

.> view base.List.Nonempty.scanl

  base.List.Nonempty.scanl :
    (a ->{e} a ->{e} a) -> Nonempty a ->{e} Nonempty a
  base.List.Nonempty.scanl f = cases
    Nonempty x xs -> List.scanl f x xs

base.List.Nonempty.scanl.examples.asDoc

.> view base.List.Nonempty.scanl.examples.asDoc

  base.List.Nonempty.scanl.examples.asDoc : Doc
  base.List.Nonempty.scanl.examples.asDoc =
    Join
      (intersperse
        (Join [Blob "\n---\n"])
        (List.map
          example
          [ termLink #dd0v3vceq7,
            termLink #e38r59v64t,
            termLink #m7lu70frv4,
            termLink #1njj9qukuo,
            termLink #hoqnctrp0k,
            termLink #snkbekp1ma ]))

base.List.Nonempty.scanl.test

.> view base.List.Nonempty.scanl.test

  base.List.Nonempty.scanl.test : [Result]
  base.List.Nonempty.scanl.test =
    use Int -
    runs
      100
      'let
        x = !int
        y = !int
        z = !int
        expect
          (   Nonempty.scanl (-) (Nonempty x [y, z])
          == Nonempty x [x - y, x - y - z])

base.List.Nonempty.scanr

.> view base.List.Nonempty.scanr

  base.List.Nonempty.scanr :
    (a ->{e} a ->{e} a) -> Nonempty a ->{e} Nonempty a
  base.List.Nonempty.scanr f = cases
    Nonempty x (ys :+ y) -> List.scanr f y (x +: ys)
    xs                   -> xs

base.List.Nonempty.scanr.examples.asDoc

.> view base.List.Nonempty.scanr.examples.asDoc

  base.List.Nonempty.scanr.examples.asDoc : Doc
  base.List.Nonempty.scanr.examples.asDoc =
    Join
      (intersperse
        (Join [Blob "\n---\n"])
        (List.map
          example
          [ termLink #o4gloskcka,
            termLink #gah4msce9o,
            termLink #2d69arnre9,
            termLink #v7usjp7c1n,
            termLink #2d7ppcvn7o,
            termLink #14q372ps14 ]))

base.List.Nonempty.scanr.test

.> view base.List.Nonempty.scanr.test

  base.List.Nonempty.scanr.test : [Result]
  base.List.Nonempty.scanr.test =
    use Int -
    runs
      100
      'let
        x = !int
        y = !int
        z = !int
        expect
          (   Nonempty.scanr (-) (Nonempty x [y, z])
          == Nonempty (x - (y - z)) [y - z, z])

base.List.Nonempty.singleton

.> view base.List.Nonempty.singleton

  base.List.Nonempty.singleton : a -> Nonempty a
  base.List.Nonempty.singleton a = Nonempty a []

base.List.Nonempty.singleton.test

.> view base.List.Nonempty.singleton.test

  base.List.Nonempty.singleton.test : [Result]
  base.List.Nonempty.singleton.test =
    runs
      100 'let
        n = !nat
        expect (Nonempty.size (Nonempty.singleton n) == 1)

base.List.Nonempty.size

.> view base.List.Nonempty.size

  base.List.Nonempty.size : Nonempty a -> Nat
  base.List.Nonempty.size = cases
    Nonempty _ as ->
      use Nat +
      List.size as + 1

base.List.Nonempty.size.test

.> view base.List.Nonempty.size.test

  base.List.Nonempty.size.test : [Result]
  base.List.Nonempty.size.test =
    use Nat +
    runs
      100
      'let
        units = !(atLeastOne '())
        expect
          (   Nonempty.size units
          == List.foldl
               (+)
               0
               (Nonempty.toList (Nonempty.map (const 1) units)))

base.List.Nonempty.snoc

.> view base.List.Nonempty.snoc

  base.List.Nonempty.snoc : Nonempty a -> a -> Nonempty a
  base.List.Nonempty.snoc = cases
    Nonempty head middle ->
      last -> Nonempty head (middle :+ last)

base.List.Nonempty.tail

.> view base.List.Nonempty.tail

  base.List.Nonempty.tail : Nonempty a -> [a]
  base.List.Nonempty.tail = cases Nonempty _ as -> as

base.List.Nonempty.tail.test

.> view base.List.Nonempty.tail.test

  base.List.Nonempty.tail.test : [Result]
  base.List.Nonempty.tail.test =
    runs
      100 'let
        a = !nat
        as = !(listOf nat)
        expect (Nonempty.tail (Nonempty a as) == as)

base.List.Nonempty.toList

.> view base.List.Nonempty.toList

  base.List.Nonempty.toList : Nonempty a -> [a]
  base.List.Nonempty.toList = cases Nonempty a as -> a +: as

base.List.Nonempty.|+

.> view base.List.Nonempty.|+

  (base.List.Nonempty.|+) : [a] -> a -> Nonempty a
  (base.List.Nonempty.|+) = cases
    []      -> a -> Nonempty a []
    x +: xs -> a -> Nonempty x (xs :+ a)

base.List.all

.> view base.List.all

  base.List.all : (a ->{e} Boolean) -> [a] ->{e} Boolean
  base.List.all predicate = cases
    []        -> true
    x +: rest -> (predicate x) && (base.List.all predicate rest)

base.List.all.tests.deMorgan

.> view base.List.all.tests.deMorgan

  base.List.all.tests.deMorgan : [Result]
  base.List.all.tests.deMorgan =
    runs
      100 'let
        bs = !(listOf gen.boolean)
        expect (List.all id bs == List.none not bs)

base.List.all.tests.homomorphism

.> view base.List.all.tests.homomorphism

  base.List.all.tests.homomorphism : [Result]
  base.List.all.tests.homomorphism =
    use List ++
    runs
      100
      '(laws.homomorphism
        (listOf gen.boolean) (List.all id) (++) (a b -> a && b))

base.List.any

.> view base.List.any

  base.List.any : (a ->{e} Boolean) -> [a] ->{e} Boolean
  base.List.any predicate = cases
    []        -> false
    x +: rest -> (predicate x) || (base.List.any predicate rest)

base.List.any.tests.deMorgan

.> view base.List.any.tests.deMorgan

  base.List.any.tests.deMorgan : [Result]
  base.List.any.tests.deMorgan =
    runs
      100 'let
        bs = !(listOf gen.boolean)
        expect (any id bs == not (List.all not bs))

base.List.any.tests.homomorphism

.> view base.List.any.tests.homomorphism

  base.List.any.tests.homomorphism : [Result]
  base.List.any.tests.homomorphism =
    use List ++
    runs
      100
      '(laws.homomorphism
        (listOf gen.boolean) (any id) (++) (a b -> a || b))

base.List.at

.> view base.List.at

  -- base.List.at is built-in.

base.List.concatOptional

.> view base.List.concatOptional

  base.List.concatOptional : Optional [a] -> [a]
  base.List.concatOptional = cases
    Some xs -> xs
    None    -> []

base.List.concatOptional.tests.prop1

.> view base.List.concatOptional.tests.prop1

  base.List.concatOptional.tests.prop1 : [Result]
  base.List.concatOptional.tests.prop1 =
    go _ =
      xs = !(listOf nat)
      expect (concatOptional (Some xs) == xs)
    runs 100 go

base.List.concatOptional.tests.test1

.> view base.List.concatOptional.tests.test1

  base.List.concatOptional.tests.test1 : [Result]
  base.List.concatOptional.tests.test1 =
    check (concatOptional None == [])

base.List.cons

.> view base.List.cons

  -- base.List.+: is built-in.

base.List.contains

.> view base.List.contains

  base.List.contains : a -> [a] -> Boolean
  base.List.contains a as = isSome <| indexOf a as

base.List.contains.tests.prop1

.> view base.List.contains.tests.prop1

  base.List.contains.tests.prop1 : [Result]
  base.List.contains.tests.prop1 =
    go _ =
      use List ++
      a = !(listOf nat)
      b = !nat
      c = !(listOf nat)
      expect (elem b (a :+ b ++ c))
    runs 100 go

base.List.deleteAt

.> view base.List.deleteAt

  base.List.deleteAt : Nat -> [a] -> [a]
  base.List.deleteAt n as =
    use List ++
    use Nat +
    slice 0 n as ++ slice (n + 1) (List.size as) as

base.List.deleteAt.test

.> view base.List.deleteAt.test

  base.List.deleteAt.test : [Result]
  base.List.deleteAt.test =
    use List ++
    runs
      100
      'let
        xs = !(listOf nat)
        ys = !(listOf nat)
        x = !nat
        expect
          (   deleteAt (List.size xs) (xs ++ [x] ++ ys)
          == (xs ++ ys))

base.List.diagonal

.> view base.List.diagonal

  base.List.diagonal : [[a]] -> [a]
  base.List.diagonal =
    x = 23
    stripe = cases
      []             -> []
      [] +: xxs      -> stripe xxs
      x +: xs +: xxs -> [x] +: zipCons xs (stripe xxs)
    zipCons xs ys =
      match (xs, ys) with
        ([], ys)           -> ys
        (xs, [])           -> List.map (x -> [x]) xs
        (x +: xs, y +: ys) -> x +: y +: zipCons xs ys
     List.join stripe

base.List.distinct

.> view base.List.distinct

  base.List.distinct : [a] -> [a]
  base.List.distinct as =
    go i seen acc =
      match List.at i as with
        None   -> acc
        Some a ->
          use Nat +
          if Set.contains a seen then go (i + 1) seen acc
          else go (i + 1) (Set.insert a seen) (acc :+ a)
    go 0 Set.empty []

base.List.drop

.> view base.List.drop

  -- base.List.drop is built-in.

base.List.dropLast

.> view base.List.dropLast

  base.List.dropLast : [a] -> [a]
  base.List.dropLast = cases
    []      -> []
    xs :+ _ -> xs

base.List.dropWhile

.> view base.List.dropWhile

  base.List.dropWhile : (a ->{e} Boolean) -> [a] ->{e} [a]
  base.List.dropWhile f = cases
    []             -> []
    x +: xs' | f x -> base.List.dropWhile f xs'
    xs             -> xs

base.List.dropWhile.examples.ex1

.> view base.List.dropWhile.examples.ex1

  base.List.dropWhile.examples.ex1 : [Nat]
  base.List.dropWhile.examples.ex1 =
    dropWhile (x -> x < 3) [1, 2, 3, 4, 5]

base.List.dropWhile.examples.ex1.asDoc

.> view base.List.dropWhile.examples.ex1.asDoc

  base.List.dropWhile.examples.ex1.asDoc : Doc
  base.List.dropWhile.examples.ex1.asDoc =
    example termLink dropWhile.examples.ex1

base.List.dropWhile.tests.all

.> view base.List.dropWhile.tests.all

  base.List.dropWhile.tests.all : [Result]
  base.List.dropWhile.tests.all =
    check (dropWhile (flip (<) 9) [1, 2, 3] == [])

base.List.dropWhile.tests.middle

.> view base.List.dropWhile.tests.middle

  base.List.dropWhile.tests.middle : [Result]
  base.List.dropWhile.tests.middle =
    check
      (   dropWhile (flip (<) 3) [1, 2, 3, 4, 5, 1, 2]
      == [3, 4, 5, 1, 2])

base.List.dropWhile.tests.none

.> view base.List.dropWhile.tests.none

  base.List.dropWhile.tests.none : [Result]
  base.List.dropWhile.tests.none =
    check (dropWhile (flip (<) 0) [1, 2, 3] == [1, 2, 3])

base.List.empty

.> view base.List.empty

  base.List.empty : [a]
  base.List.empty = []

base.List.filter

.> view base.List.filter

  base.List.filter : (a ->{𝕖} Boolean) -> [a] ->{𝕖} [a]
  base.List.filter pred as =
    List.foldl
      (acc a -> (if pred a then acc :+ a else acc)) [] as

base.List.filter.tests.empty

.> view base.List.filter.tests.empty

  base.List.filter.tests.empty : [Result]
  base.List.filter.tests.empty =
    check (filter (x -> x > 3) [] == [])

base.List.filter.tests.negative

.> view base.List.filter.tests.negative

  base.List.filter.tests.negative : [Result]
  base.List.filter.tests.negative =
    check (filter (x -> x > 3) [0, 1, 2] == [])

base.List.filter.tests.positive

.> view base.List.filter.tests.positive

  base.List.filter.tests.positive : [Result]
  base.List.filter.tests.positive =
    check (filter (x -> x > 3) [3, 4, 5] == [4, 5])

base.List.filterMap

.> view base.List.filterMap

  base.List.filterMap : (a ->{𝕖} Optional b) -> [a] ->{𝕖} [b]
  base.List.filterMap f =
    List.flatMap
      (e ->
        (match f e with
          None   -> []
          Some v -> [v]))

base.List.filterMap.examples.ex1

.> view base.List.filterMap.examples.ex1

  base.List.filterMap.examples.ex1 : [Nat]
  base.List.filterMap.examples.ex1 =
    dict = Map.fromList [("Foo", 42), ("Bar", 100), ("Baz", 40)]
    filterMap (k -> Map.lookup k dict) ["Foo", "Bar", "Qux"]

base.List.flatMap

.> view base.List.flatMap

  base.List.flatMap : (a ->{e} [b]) -> [a] ->{e} [b]
  base.List.flatMap f =
    use List ++
    List.foldr (e acc -> f e ++ acc) []

base.List.flatMap.examples.ex1

.> view base.List.flatMap.examples.ex1

  base.List.flatMap.examples.ex1 : [Nat]
  base.List.flatMap.examples.ex1 =
    use Nat *
    List.flatMap (x -> [x, x * x]) [1, 2, 3, 4]

base.List.flatMap.examples.ex2

.> view base.List.flatMap.examples.ex2

  base.List.flatMap.examples.ex2 : [Nat]
  base.List.flatMap.examples.ex2 =
    xs = [(1, 2), (2, 3), (3, 4)]
    List.flatMap
      (cases
        (amount, element) ->
          List.map 'element (List.range 0 amount))
      xs

base.List.flatMap.tests.flatMapIdentityIsJoin

.> view base.List.flatMap.tests.flatMapIdentityIsJoin

  base.List.flatMap.tests.flatMapIdentityIsJoin : [Result]
  base.List.flatMap.tests.flatMapIdentityIsJoin =
    runs
      100 'let
        xs = !(listOf (listOf nat))
        expect (List.join xs == List.flatMap id xs)

base.List.foldb

.> view base.List.foldb

  base.List.foldb : (a -> b) -> (b -> b -> b) -> b -> [a] -> b
  base.List.foldb f op z as =
    use List size
    if size as == 0 then z
    else
      if size as == 1 then f (unsafeAt 0 as)
      else
        match halve as with
          (left, right) ->
            use base.List foldb
            op (foldb f op z left) (foldb f op z right)

base.List.foldl

.> view base.List.foldl

  base.List.foldl : (b ->{𝕖} a ->{𝕖} b) -> b -> [a] ->{𝕖} b
  base.List.foldl f b as =
    go b i =
      match List.at i as with
        None   -> b
        Some a ->
          use Nat +
          go (f b a) (i + 1)
    go b 0

base.List.foldr

.> view base.List.foldr

  base.List.foldr : (a ->{e} b ->{e} b) -> b -> [a] ->{e} b
  base.List.foldr f b as =
    go b i =
      next = Nat.decrement i
      match List.at next as with
        Some a | next == 0 -> f a b
        Some a             -> go (f a b) next
        None               -> b
    go b (List.size as)

base.List.foldr.tests.homomorphism

.> view base.List.foldr.tests.homomorphism

  base.List.foldr.tests.homomorphism : [Result]
  base.List.foldr.tests.homomorphism =
    runs
      100 'let
        xs = !(listOf nat)
        expect (List.foldr (+:) [] xs == xs)

base.List.group

.> view base.List.group

  base.List.group : [a] -> [Nonempty a]
  base.List.group = groupBy (==)

base.List.group.tests.base

.> view base.List.group.tests.base

  base.List.group.tests.base : [Result]
  base.List.group.tests.base =
    check
      (#k8vae6ac1v [1, 2, 2, 3, 2] == [[1], [2, 2], [3], [2]])

base.List.groupBy

.> view base.List.groupBy

  base.List.groupBy :
    (a ->{e} a ->{e} Boolean) -> [a] ->{e} [Nonempty a]
  base.List.groupBy p' = cases
    []        -> []
    x' +: xs' ->
      go p z = cases
        []      -> ([], [])
        x +: xs ->
          match go p x xs with
            (ys, zs) ->
              if p z x then (x +: ys, zs)
              else ([], x +| ys +: zs)
      match go p' x' xs' with (ys', zs') -> x' +| ys' +: zs'

base.List.groupBy.examples.ex1

.> view base.List.groupBy.examples.ex1

  base.List.groupBy.examples.ex1 : [[Nat]]
  base.List.groupBy.examples.ex1 =
    List.map Nonempty.toList (groupBy (==) [5, 4, 4, 6])

base.List.groupBy.examples.ex1.asDoc

.> view base.List.groupBy.examples.ex1.asDoc

  base.List.groupBy.examples.ex1.asDoc : Doc
  base.List.groupBy.examples.ex1.asDoc =
    example termLink groupBy.examples.ex1

base.List.groupBy.examples.ex2

.> view base.List.groupBy.examples.ex2

  base.List.groupBy.examples.ex2 : [[Nat]]
  base.List.groupBy.examples.ex2 =
    List.map Nonempty.toList (groupBy (<) [5, 6, 7, 5, 9, 7, 6])

base.List.groupBy.examples.ex2.asDoc

.> view base.List.groupBy.examples.ex2.asDoc

  base.List.groupBy.examples.ex2.asDoc : Doc
  base.List.groupBy.examples.ex2.asDoc =
    example termLink groupBy.examples.ex2

base.List.halve

.> view base.List.halve

  base.List.halve : [a] -> ([a], [a])
  base.List.halve s =
    n =
      use Nat /
      List.size s / 2
    (List.take n s, List.drop n s)

base.List.head

.> view base.List.head

  base.List.head : [a] -> Optional a
  base.List.head = cases
    []     -> None
    a +: _ -> Some a

base.List.head.examples.evaluated.elems

.> view base.List.head.examples.evaluated.elems

  base.List.head.examples.evaluated.elems : Optional Nat
  base.List.head.examples.evaluated.elems =
    List.head examples.elems

base.List.head.examples.evaluated.empty

.> view base.List.head.examples.evaluated.empty

  base.List.head.examples.evaluated.empty : Optional a
  base.List.head.examples.evaluated.empty =
    List.head examples.empty

base.List.head.examples.evaluated.single

.> view base.List.head.examples.evaluated.single

  base.List.head.examples.evaluated.single : Optional Nat
  base.List.head.examples.evaluated.single =
    List.head examples.single

base.List.head.test

.> view base.List.head.test

  base.List.head.test : [Result]
  base.List.head.test =
    use List head
    runs
      100 'let
        x = !nat
        xs = !(listOf nat)
        expect ((head (x +: xs) == Some x) && (head [] == None))

base.List.indexed

.> view base.List.indexed

  base.List.indexed : [a] -> [(a, Nat)]
  base.List.indexed as = zip as (List.range 0 (List.size as))

base.List.init

.> view base.List.init

  base.List.init : [a] -> Optional [a]
  base.List.init = cases
    []      -> None
    xs :+ _ -> Some xs

base.List.inits

.> view base.List.inits

  base.List.inits : [a] -> [[a]]
  base.List.inits l =
    is =
      match l with
        []      -> []
        xs :+ _ -> base.List.inits xs
    is :+ l

base.List.insert

.> view base.List.insert

  base.List.insert : Nat -> a -> [a] -> [a]
  base.List.insert i a as =
    use List ++
    List.take i as ++ [a] ++ List.drop i as

base.List.intercalate

.> view base.List.intercalate

  base.List.intercalate : [a] -> [[a]] -> [a]
  base.List.intercalate between = cases
    []        -> []
    xs +: xxs ->
      use List ++
      xs ++ List.flatMap (as -> between ++ as) xxs

base.List.intercalate.tests.empty

.> view base.List.intercalate.tests.empty

  base.List.intercalate.tests.empty : [Result]
  base.List.intercalate.tests.empty =
    check (intercalate [] [] == [])

base.List.intercalate.tests.empty1

.> view base.List.intercalate.tests.empty1

  base.List.intercalate.tests.empty1 : [Result]
  base.List.intercalate.tests.empty1 =
    check (intercalate [] [[1], [2]] == [1, 2])

base.List.intercalate.tests.empty2

.> view base.List.intercalate.tests.empty2

  base.List.intercalate.tests.empty2 : [Result]
  base.List.intercalate.tests.empty2 =
    check (intercalate [1] [] == [])

base.List.intercalate.tests.simple

.> view base.List.intercalate.tests.simple

  base.List.intercalate.tests.simple : [Result]
  base.List.intercalate.tests.simple =
    check
      (   intercalate [3, 4] [[1, 2], [5, 6]]
      == [1, 2, 3, 4, 5, 6])

base.List.intercalate.tests.size

.> view base.List.intercalate.tests.size

  base.List.intercalate.tests.size : [Result]
  base.List.intercalate.tests.size =
    go _ =
      use List size
      expect
        let
          l = !(listOf nat)
          v = !(listOf (listOf nat))
          i = intercalate l v
          actual = size i
          expected =
            use Nat * + -
              size (List.join v)
            + (size l * truncate0 (size v - 1))
          if not (expected == actual) then
            bug ("Not equal!", expected, actual, l, v)
          else true
    runs 100 go

base.List.intersperse

.> view base.List.intersperse

  base.List.intersperse : a -> [a] -> [a]
  base.List.intersperse sep ls =
    prependToAll : a -> [a] -> [a]
    prependToAll sep = cases
      []      -> []
      a +: as ->
        use List ++
        [sep, a] ++ prependToAll sep as
    match ls with
      []      -> []
      a +: as -> a +: prependToAll sep as

base.List.intersperse.tests.base

.> view base.List.intersperse.tests.base

  base.List.intersperse.tests.base : [Result]
  base.List.intersperse.tests.base =
    sep = ?,
    list = [?a, ?b, ?c, ?d]
    check (intersperse sep list == [?a, ?,, ?b, ?,, ?c, ?,, ?d])

base.List.intersperse.tests.empty

.> view base.List.intersperse.tests.empty

  base.List.intersperse.tests.empty : [Result]
  base.List.intersperse.tests.empty =
    sep = 0
    list = []
    check (intersperse sep list == [])

base.List.isInfixOf

.> view base.List.isInfixOf

  base.List.isInfixOf : [a] -> [a] -> Boolean
  base.List.isInfixOf infix list =
    (isPrefixOf infix list) || (match list with
      _ +: xs -> base.List.isInfixOf infix xs
      []      -> false)

base.List.isInfixOf.tests.prop1

.> view base.List.isInfixOf.tests.prop1

  base.List.isInfixOf.tests.prop1 : [Result]
  base.List.isInfixOf.tests.prop1 =
    go _ =
      use List ++
      a = !(listOf nat)
      b = !(listOf nat)
      c = !(listOf nat)
      expect (isInfixOf b (a ++ b ++ c))
    runs 100 go

base.List.isPrefixOf

.> view base.List.isPrefixOf

  base.List.isPrefixOf : [a] -> [a] -> Boolean
  base.List.isPrefixOf prefix list =
    match prefix with
      p +: ps ->
        match list with
          x +: xs -> (p == x) && (base.List.isPrefixOf ps xs)
          []      -> false
      []      -> true

base.List.isPrefixOf.tests.prop1

.> view base.List.isPrefixOf.tests.prop1

  base.List.isPrefixOf.tests.prop1 : [Result]
  base.List.isPrefixOf.tests.prop1 =
    go _ =
      use List ++
      a = !(listOf nat)
      b = !(listOf nat)
      expect (isPrefixOf a (a ++ b))
    runs 100 go

base.List.isPrefixOf.tests.prop2

.> view base.List.isPrefixOf.tests.prop2

  base.List.isPrefixOf.tests.prop2 : [Result]
  base.List.isPrefixOf.tests.prop2 =
    go _ =
      use List ++ size
      use Universal !=
      a = !(listOf nat)
      b = !(listOf nat)
      c = !(listOf nat)
      expect
        ((size a != size b)
        ||
        (a == b == isPrefixOf a (b ++ c)))
    runs 100 go

base.List.isSuffixOf

.> view base.List.isSuffixOf

  base.List.isSuffixOf : [a] -> [a] -> Boolean
  base.List.isSuffixOf suffix list =
    match suffix with
      ss :+ s ->
        match list with
          xs :+ x -> (s == x) && (base.List.isSuffixOf ss xs)
          []      -> false
      []      -> true

base.List.isSuffixOf.tests.prop1

.> view base.List.isSuffixOf.tests.prop1

  base.List.isSuffixOf.tests.prop1 : [Result]
  base.List.isSuffixOf.tests.prop1 =
    go _ =
      use List ++
      a = !(listOf nat)
      b = !(listOf nat)
      expect (isSuffixOf b (a ++ b))
    runs 100 go

base.List.isSuffixOf.tests.prop2

.> view base.List.isSuffixOf.tests.prop2

  base.List.isSuffixOf.tests.prop2 : [Result]
  base.List.isSuffixOf.tests.prop2 =
    go _ =
      use List ++ size
      use Universal !=
      a = !(listOf nat)
      b = !(listOf nat)
      c = !(listOf nat)
      expect
        ((size b != size c)
        ||
        (b == c == isSuffixOf c (a ++ b)))
    runs 100 go

base.List.join

.> view base.List.join

  base.List.join : [[a]] -> [a]
  base.List.join =
    use List ++
    List.foldl (++) []

base.List.join.tests.associative

.> view base.List.join.tests.associative

  base.List.join.tests.associative : [Result]
  base.List.join.tests.associative =
    use List join
    runs
      100 'let
        x = !(listOf (listOf (listOf nat)))
        expect (join (join x) == join (List.map join x))

base.List.join.tests.homomorphism

.> view base.List.join.tests.homomorphism

  base.List.join.tests.homomorphism : [Result]
  base.List.join.tests.homomorphism =
    use List ++
    runs
      100 'let
        x = !(listOf nat)
        y = !(listOf nat)
        expect (List.join [x, y] == (x ++ y))

base.List.join.tests.unit

.> view base.List.join.tests.unit

  base.List.join.tests.unit : [Result]
  base.List.join.tests.unit =
    use List join
    runs
      100 'let
        x = !(listOf nat)
        expect (join [x] == join (List.map (a -> [a]) x))

base.List.last

.> view base.List.last

  base.List.last : [a] -> Optional a
  base.List.last xs = List.at (Nat.drop (List.size xs) 1) xs

base.List.last.examples.elems

.> view base.List.last.examples.elems

  base.List.last.examples.elems : [Nat]
  base.List.last.examples.elems = [1, 2, 3]

base.List.last.examples.empty

.> view base.List.last.examples.empty

  base.List.empty : [a]
  base.List.empty = []

base.List.last.examples.evaluated.elems

.> view base.List.last.examples.evaluated.elems

  base.List.last.examples.evaluated.elems : Optional Nat
  base.List.last.examples.evaluated.elems =
    List.last examples.elems

base.List.last.examples.evaluated.empty

.> view base.List.last.examples.evaluated.empty

  base.List.last.examples.evaluated.empty : Optional a
  base.List.last.examples.evaluated.empty =
    List.last examples.empty

base.List.last.examples.evaluated.single

.> view base.List.last.examples.evaluated.single

  base.List.last.examples.evaluated.single : Optional Nat
  base.List.last.examples.evaluated.single =
    List.last examples.single

base.List.last.examples.single

.> view base.List.last.examples.single

  base.List.last.examples.single : [Nat]
  base.List.last.examples.single = [1]

base.List.last.tests.elems

.> view base.List.last.tests.elems

  base.List.last.tests.elems : [Result]
  base.List.last.tests.elems =
    check (List.last examples.elems == Some 3)

base.List.last.tests.empty

.> view base.List.last.tests.empty

  base.List.last.tests.empty : [Result]
  base.List.last.tests.empty =
    check (List.last examples.empty == None)

base.List.last.tests.single

.> view base.List.last.tests.single

  base.List.last.tests.single : [Result]
  base.List.last.tests.single =
    check (List.last examples.single == Some 1)

base.List.lefts

.> view base.List.lefts

  base.List.lefts : [Either a b] -> [a]
  base.List.lefts =  at1 partitionEithers

base.List.lefts.tests.ex1

.> view base.List.lefts.tests.ex1

  base.List.lefts.tests.ex1 : [Result]
  base.List.lefts.tests.ex1 =
    check
      let
        actual =
          lefts
            [ Left 2,
              Right "Hello",
              Left 10,
              Right "Hello again" ]
        expected = [2, 10]
        assert
          (actual == expected)
          ("Not equal!", actual, expected)
          true

base.List.map

.> view base.List.map

  base.List.map : (a ->{𝕖} b) -> [a] ->{𝕖} [b]
  base.List.map f a =
    go i as acc =
      match List.at i as with
        None   -> acc
        Some a ->
          use Nat +
          go (i + 1) as (acc :+ f a)
    go 0 a []

base.List.mapIndexed

.> view base.List.mapIndexed

  base.List.mapIndexed : (Nat ->{𝕖} a ->{𝕖} b) -> [a] ->{𝕖} [b]
  base.List.mapIndexed f xs =
    at2
      (List.foldl
        (acc e ->
          (match acc with
            (c, res) ->
              use Nat +
              (c + 1, res :+ f c e))) (0, []) xs)

base.List.mapIndexed.tests.ex1

.> view base.List.mapIndexed.tests.ex1

  base.List.mapIndexed.tests.ex1 : [Result]
  base.List.mapIndexed.tests.ex1 =
    check (mapIndexed const ["Foo", "Bar", "Baz"] == [0, 1, 2])

base.List.mapIndexed.tests.ex2

.> view base.List.mapIndexed.tests.ex2

  base.List.mapIndexed.tests.ex2 : [Result]
  base.List.mapIndexed.tests.ex2 =
    check
      (   mapIndexed (i v -> (i, v)) [5, 3, 1]
      == [(0, 5), (1, 3), (2, 1)])

base.List.maximum

.> view base.List.maximum

  base.List.maximum : [a] -> Optional a
  base.List.maximum list =
    go x = cases
      []              -> Some x
      y +: ys | y > x -> go y ys
      _ +: ys         -> go x ys
    match list with
      x +: xs -> go x xs
      []      -> None

base.List.maximum.tests.base

.> view base.List.maximum.tests.base

  base.List.maximum.tests.base : [Result]
  base.List.maximum.tests.base =
    check (maximum [1, 2, 90, 3, 5] == Some 90)

base.List.maximum.tests.empty

.> view base.List.maximum.tests.empty

  base.List.maximum.tests.empty : [Result]
  base.List.maximum.tests.empty = check (maximum [] == None)

base.List.minimum

.> view base.List.minimum

  base.List.minimum : [a] -> Optional a
  base.List.minimum list =
    go x = cases
      []              -> Some x
      y +: ys | y < x -> go y ys
      _ +: ys         -> go x ys
    match list with
      x +: xs -> go x xs
      []      -> None

base.List.minimum.tests.base

.> view base.List.minimum.tests.base

  base.List.minimum.tests.base : [Result]
  base.List.minimum.tests.base =
    check (minimum [+1, +20, -30, +4] == Some -30)

base.List.nonEmptySubsequences

.> view base.List.nonEmptySubsequences

  base.List.nonEmptySubsequences : [a] -> [Nonempty a]
  base.List.nonEmptySubsequences list =
    f : a -> Nonempty a -> [Nonempty a] -> [Nonempty a]
    f x ys r = ys +: (Nonempty.cons x ys +: r)
    match list with
      []      -> []
      x +: xs ->
           Nonempty.singleton x
        +: List.foldr
             (f x) [] (base.List.nonEmptySubsequences xs)

base.List.nonEmptySubsequences.tests.base

.> view base.List.nonEmptySubsequences.tests.base

  base.List.nonEmptySubsequences.tests.base : [Result]
  base.List.nonEmptySubsequences.tests.base =
    use Nonempty singleton
    check
      (   nonEmptySubsequences [1, 2, 3]
      == [ singleton 1,
           singleton 2,
           1 +| [2],
           singleton 3,
           1 +| [3],
           2 +| [3],
           1 +| [2, 3] ])

base.List.none

.> view base.List.none

  base.List.none : (i ->{e} Boolean) -> [i] ->{e} Boolean
  base.List.none predicate = List.all (x -> not (predicate x))

base.List.nonempty

.> view base.List.nonempty

  base.List.nonempty : [a] -> Optional (Nonempty a)
  base.List.nonempty = cases
    []      -> None
    x +: xs -> Some (Nonempty x xs)

base.List.partitionEithers

.> view base.List.partitionEithers

  base.List.partitionEithers : [Either a b] -> ([a], [b])
  base.List.partitionEithers =
    List.foldr
      (elem acc ->
        (match (elem, acc) with
          (Left a, (lefts, rights))  -> (a +: lefts, rights)
          (Right b, (lefts, rights)) -> (lefts, b +: rights)))
      ([], [])

base.List.partitionEithers.tests.ex1

.> view base.List.partitionEithers.tests.ex1

  base.List.partitionEithers.tests.ex1 : [Result]
  base.List.partitionEithers.tests.ex1 =
    check
      let
        actual =
          partitionEithers
            [ Left 2,
              Right "Hello",
              Left 10,
              Right "Hello again" ]
        expected = ([2, 10], ["Hello", "Hello again"])
        assert
          (actual == expected)
          ("Not equal!", actual, expected)
          true

base.List.powerslice

.> view base.List.powerslice

  base.List.powerslice : [a] -> [[a]]
  base.List.powerslice l =
    [] +: List.flatMap ( dropLast tails) (inits l)

base.List.powerslice.examples.ex1

.> view base.List.powerslice.examples.ex1

  base.List.powerslice.examples.ex1 : [[Nat]]
  base.List.powerslice.examples.ex1 = powerslice [1, 2, 3]

base.List.powerslice.examples.ex2

.> view base.List.powerslice.examples.ex2

  base.List.powerslice.examples.ex2 : [[a]]
  base.List.powerslice.examples.ex2 = powerslice []

base.List.powerslice.tests.prop1

.> view base.List.powerslice.tests.prop1

  base.List.powerslice.tests.prop1 : [Result]
  base.List.powerslice.tests.prop1 =
    go _ =
      use List ++
      a = !(listOf nat)
      b = !(listOf nat)
      c = !(listOf nat)
      expect (elem b (powerslice (a ++ b ++ c)))
    runs 100 go

base.List.powerslice.tests.test1

.> view base.List.powerslice.tests.test1

  base.List.powerslice.tests.test1 : [Result]
  base.List.powerslice.tests.test1 =
    check
      (   powerslice [1, 2, 3]
      == [[], [1], [1, 2], [2], [1, 2, 3], [2, 3], [3]])

base.List.range

.> view base.List.range

  base.List.range : Nat -> Nat -> [Nat]
  base.List.range start stopExclusive =
    f i =
      if i < stopExclusive then
        use Nat +
        Some (i, i + 1)
      else None
    unfold start f

base.List.range.examples.invalid.descFromNeg

.> view base.List.range.examples.invalid.descFromNeg

  base.List.range.examples.invalid.descFromNeg : [Int]
  base.List.range.examples.invalid.descFromNeg = Int.range +0 -1

base.List.range.examples.invalid.descFromPos

.> view base.List.range.examples.invalid.descFromPos

  base.List.range.examples.invalid.descFromPos : [Int]
  base.List.range.examples.invalid.descFromPos = Int.range +1 +0

base.List.range.examples.valid.ascFromNeg

.> view base.List.range.examples.valid.ascFromNeg

  base.List.range.examples.valid.ascFromNeg : [Int]
  base.List.range.examples.valid.ascFromNeg = Int.range -1 +0

base.List.range.examples.valid.ascFromNeg2

.> view base.List.range.examples.valid.ascFromNeg2

  base.List.range.examples.valid.ascFromNeg2 : [Int]
  base.List.range.examples.valid.ascFromNeg2 = Int.range -1 +1

base.List.range.examples.valid.ascFromPos

.> view base.List.range.examples.valid.ascFromPos

  base.List.range.examples.valid.ascFromPos : [Int]
  base.List.range.examples.valid.ascFromPos = Int.range +0 +1

base.List.range.tests.invalid.descFromNeg

.> view base.List.range.tests.invalid.descFromNeg

  base.List.range.tests.invalid.descFromNeg : [Result]
  base.List.range.tests.invalid.descFromNeg =
    check (examples.invalid.descFromNeg == [])

base.List.range.tests.invalid.descFromPos

.> view base.List.range.tests.invalid.descFromPos

  base.List.range.tests.invalid.descFromPos : [Result]
  base.List.range.tests.invalid.descFromPos =
    check (examples.invalid.descFromPos == [])

base.List.range.tests.valid.ascFromNeg

.> view base.List.range.tests.valid.ascFromNeg

  base.List.range.tests.valid.ascFromNeg : [Result]
  base.List.range.tests.valid.ascFromNeg =
    check (examples.valid.ascFromNeg == [-1])

base.List.range.tests.valid.ascFromNeg2

.> view base.List.range.tests.valid.ascFromNeg2

  base.List.range.tests.valid.ascFromNeg2 : [Result]
  base.List.range.tests.valid.ascFromNeg2 =
    check (examples.valid.ascFromNeg2 == [-1, +0])

base.List.range.tests.valid.ascFromPos

.> view base.List.range.tests.valid.ascFromPos

  base.List.range.tests.valid.ascFromPos : [Result]
  base.List.range.tests.valid.ascFromPos =
    check (examples.valid.ascFromPos == [+0])

base.List.replace

.> view base.List.replace

  base.List.replace : Nat -> a -> [a] -> [a]
  base.List.replace i a as =
    use List ++
    use Nat +
    List.take i as ++ [a] ++ List.drop (i + 1) as

base.List.replicate

.> view base.List.replicate

  base.List.replicate : Nat -> '{e} a ->{e} [a]
  base.List.replicate n op =
    unfold
      n
      (n -> (if n == 0 then None else Some (!op, Nat.drop n 1)))

base.List.replicate.test

.> view base.List.replicate.test

  base.List.replicate.test : [Result]
  base.List.replicate.test =
    runs
      100 'let
        n = !nat
        h = cases
          {ask -> k} -> handle !k with h
          { a }      -> a
        units : [()]
        units = handle replicate n 'ask with h
        expect (List.size units == n)

base.List.reverse

.> view base.List.reverse

  base.List.reverse : [a] -> [a]
  base.List.reverse as = List.foldl (acc a -> a +: acc) [] as

base.List.rights

.> view base.List.rights

  base.List.rights : [Either a b] -> [b]
  base.List.rights =  at2 partitionEithers

base.List.rights.tests.ex1

.> view base.List.rights.tests.ex1

  base.List.rights.tests.ex1 : [Result]
  base.List.rights.tests.ex1 =
    check
      let
        actual =
          rights
            [ Left 2,
              Right "Hello",
              Left 10,
              Right "Hello again" ]
        expected = ["Hello", "Hello again"]
        assert
          (actual == expected)
          ("Not equal!", actual, expected)
          true

base.List.scanl

.> view base.List.scanl

  base.List.scanl :
    (b ->{e} a ->{e} b) -> b -> [a] ->{e} Nonempty b
  base.List.scanl f initial values =
    go acc f q = cases
      []      -> acc
      x +: xs ->
        next = f q x
        go (Nonempty.snoc acc next) f next xs
    go (Nonempty.singleton initial) f initial values

base.List.scanl.examples.asDoc

.> view base.List.scanl.examples.asDoc

  base.List.scanl.examples.asDoc : Doc
  base.List.scanl.examples.asDoc =
    Join
      (intersperse
        (Join [Blob "\n---\n"])
        (List.map
          example
          [ termLink scanl.examples.ex1,
            termLink scanl.examples.ex2,
            termLink scanl.examples.ex3,
            termLink scanl.examples.ex4,
            termLink scanl.examples.ex5 ]))

base.List.scanl.examples.ex1

.> view base.List.scanl.examples.ex1

  base.List.scanl.examples.ex1 : Nonempty Nat
  base.List.scanl.examples.ex1 =
    use Nat /
    List.scanl (/) 64 [4, 2, 4]

base.List.scanl.examples.ex2

.> view base.List.scanl.examples.ex2

  base.List.scanl.examples.ex2 : Nonempty Nat
  base.List.scanl.examples.ex2 =
    use Nat /
    List.scanl (/) 3 []

base.List.scanl.examples.ex3

.> view base.List.scanl.examples.ex3

  base.List.scanl.examples.ex3 : Nonempty Nat
  base.List.scanl.examples.ex3 =
    List.scanl Universal.max 5 [1, 2, 3, 4]

base.List.scanl.examples.ex4

.> view base.List.scanl.examples.ex4

  base.List.scanl.examples.ex4 : Nonempty Nat
  base.List.scanl.examples.ex4 =
    List.scanl Universal.max 5 [1, 2, 3, 4, 5, 6, 7]

base.List.scanl.examples.ex5

.> view base.List.scanl.examples.ex5

  base.List.scanl.examples.ex5 : Nonempty Nat
  base.List.scanl.examples.ex5 =
    use Nat * +
    List.scanl (x y -> 2 * x + y) 4 [1, 2, 3]

base.List.scanl.test

.> view base.List.scanl.test

  base.List.scanl.test : [Result]
  base.List.scanl.test =
    use Nat +
    runs
      100
      'let
        xs = !(listOf nat)
        expect
          (   List.scanl (x y -> y + 1) 0 xs
          == (0 +| List.map (x -> x + 1) xs))

base.List.scanr

.> view base.List.scanr

  base.List.scanr :
    (a ->{e} b ->{e} b) -> b -> [a] ->{e} Nonempty b
  base.List.scanr f initial values =
    go : Nonempty b -> (a ->{e} b ->{e} b) -> b -> [a] -> Nonempty b
    go acc f q = cases
      []      -> acc
      xs :+ x ->
        next = f x q
        go (Nonempty.cons next acc) f (f x q) xs
    go (Nonempty.singleton initial) f initial values

base.List.scanr.examples.asDoc

.> view base.List.scanr.examples.asDoc

  base.List.scanr.examples.asDoc : Doc
  base.List.scanr.examples.asDoc =
    Join
      (intersperse
        (Join [Blob "\n---\n"])
        (List.map
          example
          [ termLink scanr.examples.ex1,
            termLink scanr.examples.ex2,
            termLink scanr.examples.ex3,
            termLink scanr.examples.ex4,
            termLink scanr.examples.ex5 ]))

base.List.scanr.examples.ex1

.> view base.List.scanr.examples.ex1

  base.List.scanr.examples.ex1 : Nonempty Nat
  base.List.scanr.examples.ex1 =
    use Nat +
    List.scanr (+) 5 [1, 2, 3, 4]

base.List.scanr.examples.ex2

.> view base.List.scanr.examples.ex2

  base.List.scanr.examples.ex2 : Nonempty Nat
  base.List.scanr.examples.ex2 =
    use Nat /
    List.scanr (/) 2 [8, 12, 24, 4]

base.List.scanr.examples.ex3

.> view base.List.scanr.examples.ex3

  base.List.scanr.examples.ex3 : Nonempty Nat
  base.List.scanr.examples.ex3 =
    use Nat /
    List.scanr (/) 3 []

base.List.scanr.examples.ex4

.> view base.List.scanr.examples.ex4

  base.List.scanr.examples.ex4 : Nonempty Boolean
  base.List.scanr.examples.ex4 =
    List.scanr Boolean.and true [1 > 2, 3 > 2, 5 == 5]

base.List.scanr.examples.ex5

.> view base.List.scanr.examples.ex5

  base.List.scanr.examples.ex5 : Nonempty Nat
  base.List.scanr.examples.ex5 =
    List.scanr Universal.max 18 [3, 6, 12, 4, 55, 11]

base.List.scanr.test

.> view base.List.scanr.test

  base.List.scanr.test : [Result]
  base.List.scanr.test =
    use Nat +
    runs
      100
      'let
        xs = !(listOf nat)
        expect
          (   List.scanr (x y -> x + 1) 0 xs
          == (List.map (x -> x + 1) xs |+ 0))

base.List.singleton

.> view base.List.singleton

  base.List.singleton : a -> [a]
  base.List.singleton x = [x]

base.List.size

.> view base.List.size

  -- base.List.size is built-in.

base.List.slice

.> view base.List.slice

  base.List.slice : Nat -> Nat -> [a] -> [a]
  base.List.slice start stopExclusive s =
    List.take (Nat.drop stopExclusive start) (List.drop start s)

base.List.snoc

.> view base.List.snoc

  -- base.List.:+ is built-in.

base.List.somes

.> view base.List.somes

  base.List.somes : [Optional a] -> [a]
  base.List.somes xs =
    List.foldr
      (v a ->
        (match v with
          Some x -> x +: a
          None   -> a)) [] xs

base.List.somes.tests.ex1

.> view base.List.somes.tests.ex1

  base.List.somes.tests.ex1 : [Result]
  base.List.somes.tests.ex1 =
    check
      let
        actual =
          somes [None, None, Some 2, None, None, None, Some 10]
        expected = [2, 10]
        assert
          (actual == expected)
          ("Not equal!", actual, expected)
          true

base.List.sortBy

.> view base.List.sortBy

  base.List.sortBy : (a ->{𝕖} b) -> [a] ->{𝕖} [a]
  base.List.sortBy f as =
    use List map
    tweak = cases (p1, p2) -> (f p1, p2, p1)
    sort (map tweak (indexed as)) |> map at3

base.List.span

.> view base.List.span

  base.List.span : (a ->{e} Boolean) -> [a] ->{e} ([a], [a])
  base.List.span f xs = (takeWhile f xs, dropWhile f xs)

base.List.span.tests.alle

.> view base.List.span.tests.alle

  base.List.span.tests.alle : [Result]
  base.List.span.tests.alle =
    check (span (flip (<) 0) [1, 2, 3] == ([], [1, 2, 3]))

base.List.span.tests.allf

.> view base.List.span.tests.allf

  base.List.span.tests.allf : [Result]
  base.List.span.tests.allf =
    check (span (flip (<) 9) [1, 2, 3] == ([1, 2, 3], []))

base.List.span.tests.middle

.> view base.List.span.tests.middle

  base.List.span.tests.middle : [Result]
  base.List.span.tests.middle =
    check
      (   span (flip (<) 3) [1, 2, 3, 4, 1, 2, 3, 4]
      == ([1, 2], [3, 4, 1, 2, 3, 4]))

base.List.split

.> view base.List.split

  base.List.split : (a ->{e} Boolean) -> [a] ->{e} [[a]]
  base.List.split f = cases
    []            -> [[]]
    x +: xs | f x -> [] +: base.List.split f xs
    x +: xs       ->
      match base.List.split f xs with y +: ys -> x +: y +: ys

base.List.split.tests.base

.> view base.List.split.tests.base

  base.List.split.tests.base : [Result]
  base.List.split.tests.base =
    check
      (   List.split ((==) 0) [1, 2, 0, 3, 4, 5, 0, 6, 7, 8]
      == [[1, 2], [3, 4, 5], [6, 7, 8]])

base.List.split.tests.double

.> view base.List.split.tests.double

  base.List.split.tests.double : [Result]
  base.List.split.tests.double =
    check
      (   List.split
           ((==) 0)
           [0, 0, 1, 2, 3, 0, 4, 5, 0, 0, 1, 2, 3, 0, 0]
      == [[], [], [1, 2, 3], [4, 5], [], [1, 2, 3], [], []])

base.List.split.tests.empty

.> view base.List.split.tests.empty

  base.List.split.tests.empty : [Result]
  base.List.split.tests.empty =
    check (List.split ((==) 0) [] == [[]])

base.List.splitAt

.> view base.List.splitAt

  base.List.splitAt : Nat -> [a] -> ([a], [a])
  base.List.splitAt i xs = (List.take i xs, List.drop i xs)

base.List.splitAt.tests.base

.> view base.List.splitAt.tests.base

  base.List.splitAt.tests.base : [Result]
  base.List.splitAt.tests.base =
    check (#66jnlnunrh 3 [1, 2, 3, 4, 5] == ([1, 2, 3], [4, 5]))

base.List.splitAt.tests.ob

.> view base.List.splitAt.tests.ob

  base.List.splitAt.tests.ob : [Result]
  base.List.splitAt.tests.ob =
    check (#66jnlnunrh 10 [1, 2] == ([1, 2], []))

base.List.splitAt.tests.zero

.> view base.List.splitAt.tests.zero

  base.List.splitAt.tests.zero : [Result]
  base.List.splitAt.tests.zero =
    check (#66jnlnunrh 0 [1, 2] == ([], [1, 2]))

base.List.stripPrefix

.> view base.List.stripPrefix

  base.List.stripPrefix : [a] -> [a] -> Optional [a]
  base.List.stripPrefix prefix list =
    match splitAt (List.size prefix) list with
      (p, s) -> if p == prefix then Some s else None

base.List.stripPrefix.tests.all

.> view base.List.stripPrefix.tests.all

  base.List.stripPrefix.tests.all : [Result]
  base.List.stripPrefix.tests.all =
    check (stripPrefix [1, 2, 3] [1, 2, 3] == Some [])

base.List.stripPrefix.tests.base

.> view base.List.stripPrefix.tests.base

  base.List.stripPrefix.tests.base : [Result]
  base.List.stripPrefix.tests.base =
    check (stripPrefix [1, 2] [1, 2, 3] == Some [3])

base.List.stripPrefix.tests.none

.> view base.List.stripPrefix.tests.none

  base.List.stripPrefix.tests.none : [Result]
  base.List.stripPrefix.tests.none =
    check (stripPrefix [1, 2] [3, 1, 2] == None)

base.List.subsequences

.> view base.List.subsequences

  base.List.subsequences : [a] -> [[a]]
  base.List.subsequences list =
    [] +: List.map Nonempty.toList (nonEmptySubsequences list)

base.List.subsequences.tests.base

.> view base.List.subsequences.tests.base

  base.List.subsequences.tests.base : [Result]
  base.List.subsequences.tests.base =
    check (subsequences [1, 2] == [[], [1], [2], [1, 2]])

base.List.tail

.> view base.List.tail

  base.List.tail : [a] -> Optional [a]
  base.List.tail xs = Optional.map at2 (List.uncons xs)

base.List.tail.tests.prop1

.> view base.List.tail.tests.prop1

  base.List.tail.tests.prop1 : [Result]
  base.List.tail.tests.prop1 =
    go _ =
      xs = !(listOf nat)
      expect (List.tail (1 +: xs) == Some xs)
    runs 100 go

base.List.tail.tests.test1

.> view base.List.tail.tests.test1

  base.List.tail.tests.test1 : [Result]
  base.List.tail.tests.test1 =
    check (List.tail [1, 2, 3] == Some [2, 3])

base.List.tail.tests.test2

.> view base.List.tail.tests.test2

  base.List.tail.tests.test2 : [Result]
  base.List.tail.tests.test2 = check (List.tail [] == None)

base.List.tails

.> view base.List.tails

  base.List.tails : [a] -> [[a]]
  base.List.tails l =
    l +: (match l with
      []      -> []
      _ +: xs -> base.List.tails xs)

base.List.take

.> view base.List.take

  -- base.List.take is built-in.

base.List.takeWhile

.> view base.List.takeWhile

  base.List.takeWhile : (a ->{e} Boolean) -> [a] ->{e} [a]
  base.List.takeWhile f xs =
    go acc = cases
      x +: xs | f x -> go (acc :+ x) xs
      _             -> acc
    go [] xs

base.List.takeWhile.tests.all

.> view base.List.takeWhile.tests.all

  base.List.takeWhile.tests.all : [Result]
  base.List.takeWhile.tests.all =
    check (takeWhile (flip (<) 9) [1, 2, 3] == [1, 2, 3])

base.List.takeWhile.tests.middle

.> view base.List.takeWhile.tests.middle

  base.List.takeWhile.tests.middle : [Result]
  base.List.takeWhile.tests.middle =
    check (takeWhile (flip (<) 3) [1, 2, 3, 4, 5] == [1, 2])

base.List.takeWhile.tests.none

.> view base.List.takeWhile.tests.none

  base.List.takeWhile.tests.none : [Result]
  base.List.takeWhile.tests.none =
    check (takeWhile (flip (>) 10) [1, 2, 11] == [])

base.List.uncons

.> view base.List.uncons

  base.List.uncons : [a] -> Optional (a, [a])
  base.List.uncons as =
    match List.at 0 as with
      None   -> None
      Some a -> Some (a, List.drop 1 as)

base.List.unfold

.> view base.List.unfold

  base.List.unfold : s -> (s ->{𝕖} Optional (a, s)) ->{𝕖} [a]
  base.List.unfold s0 f =
    go f s acc =
      match f s with
        None        -> acc
        Some (a, s) -> go f s (acc :+ a)
    go f s0 []

base.List.unsafeAt

.> view base.List.unsafeAt

  base.List.unsafeAt : Nat -> [a] -> a
  base.List.unsafeAt n as =
    match List.at n as with
      Some a -> a
      None   -> watch "oh noes" (base.List.unsafeAt n as)

base.List.unsnoc

.> view base.List.unsnoc

  base.List.unsnoc : [a] -> Optional ([a], a)
  base.List.unsnoc as =
    i = List.size (List.drop 1 as)
    match List.at i as with
      None   -> None
      Some a -> Some (List.take i as, a)

base.List.zip

.> view base.List.zip

  base.List.zip : [a] -> [b] -> [(a, b)]
  base.List.zip as bs =
    go acc i =
      use List at
      match (at i as, at i bs) with
        (None, _)        -> acc
        (_, None)        -> acc
        (Some a, Some b) ->
          use Nat +
          go (acc :+ (a, b)) (i + 1)
    go [] 0

base.List.zipWith

.> view base.List.zipWith

  base.List.zipWith : (a ->{𝕖} b ->{𝕖} c) -> [a] -> [b] ->{𝕖} [c]
  base.List.zipWith f a b =
    go acc as bs =
      match (as, bs) with
        (ah +: at, bh +: bt) -> go (acc :+ f ah bh) at bt
        _                    -> acc
    go [] a b

base.List.zipWith.tests.edge1

.> view base.List.zipWith.tests.edge1

  base.List.zipWith.tests.edge1 : [Result]
  base.List.zipWith.tests.edge1 =
    check
      let
        actual =
          use Nat +
          zipWith (+) [1, 5, 10] []
        expected = []
        if not (actual == expected) then
          bug ("Not equal!", actual, expected)
        else true

base.List.zipWith.tests.edge2

.> view base.List.zipWith.tests.edge2

  base.List.zipWith.tests.edge2 : [Result]
  base.List.zipWith.tests.edge2 =
    check
      let
        actual =
          use Nat +
          zipWith (+) [] []
        expected = []
        if not (actual == expected) then
          bug ("Not equal!", actual, expected)
        else true

base.List.zipWith.tests.edge3

.> view base.List.zipWith.tests.edge3

  base.List.zipWith.tests.edge3 : [Result]
  base.List.zipWith.tests.edge3 =
    use Nat +
    runs
      100 'let
        xs = !(listOf nat)
        expect (zipWith (+) xs [] == [])

base.List.zipWith.tests.edge4

.> view base.List.zipWith.tests.edge4

  base.List.zipWith.tests.edge4 : [Result]
  base.List.zipWith.tests.edge4 =
    use Nat +
    runs
      100 'let
        xs = !(listOf nat)
        expect (zipWith (+) [] xs == [])

base.List.zipWith.tests.ex1

.> view base.List.zipWith.tests.ex1

  base.List.zipWith.tests.ex1 : [Result]
  base.List.zipWith.tests.ex1 =
    check
      let
        actual =
          use Nat +
          zipWith (+) [1, 5, 10] [1, 2, 3]
        expected = [2, 7, 13]
        if not (actual == expected) then
          bug ("Not equal!", actual, expected)
        else true

base.List.zipWith.tests.ex2

.> view base.List.zipWith.tests.ex2

  base.List.zipWith.tests.ex2 : [Result]
  base.List.zipWith.tests.ex2 =
    check
      let
        xs = [1, 2, 3, 4, 5]
        ys = [7, 8, 9, 10, 11]
        actual =
          use Nat +
          zipWith (+) xs ys
        expected = [8, 10, 12, 14, 16]
        assert
          (actual == expected)
          ("Not equal", actual, expected)
          true

base.List.zipWith.tests.zipWithRange

.> view base.List.zipWith.tests.zipWithRange

  base.List.zipWith.tests.zipWithRange : [Result]
  base.List.zipWith.tests.zipWithRange =
    runs
      100
      'let
        xs = !(listOf nat)
        usingZipWith =
          zipWith
            (x y -> (x, y)) (List.range 0 (List.size xs)) xs
        usingMapIndexed = mapIndexed (x y -> (x, y)) xs
        expect (usingZipWith == usingMapIndexed)

base.Map

.> view base.Map

  type base.Map k v = Map [k] [v]

base.Map.Map

.> view base.Map.Map

  type base.Map k v = Map [k] [v]

base.Map.contains

.> view base.Map.contains

  base.Map.contains : k -> Map k v -> Boolean
  base.Map.contains k = cases
    Map ks _ ->
      match anyIndexOf k ks with
        None -> false
        _    -> true

base.Map.delete

.> view base.Map.delete

  base.Map.delete : k -> Map k v -> Map k v
  base.Map.delete k = cases
    Map ks vs ->
      i = lubIndexOf k ks
      Map (deleteAt i ks) (deleteAt i vs)

base.Map.delete.test

.> view base.Map.delete.test

  base.Map.delete.test : [Result]
  base.Map.delete.test =
    runs
      100
      'let
        k = !nat
        expect
          (not (Map.contains k (Map.delete k !(mapOf nat nat))))

base.Map.empty

.> view base.Map.empty

  base.Map.empty : Map k v
  base.Map.empty = Map [] []

base.Map.fromList

.> view base.Map.fromList

  base.Map.fromList : [(k, v)] -> Map k v
  base.Map.fromList kvs =
    go acc i =
      match List.at i kvs with
        None        -> acc
        Some (k, v) ->
          use Nat +
          go (Map.insert k v acc) (i + 1)
    go Map.empty 0

base.Map.insert

.> view base.Map.insert

  base.Map.insert : k -> v -> Map k v -> Map k v
  base.Map.insert k v = cases
    Map ks vs ->
      i = lubIndexOf k ks
      match List.at i ks with
        Some k' ->
          if k == k' then Map ks (replace i v vs)
          else
            use List insert
            Map (insert i k ks) (insert i v vs)
        None    -> Map (ks :+ k) (vs :+ v)

base.Map.intersect

.> view base.Map.intersect

  base.Map.intersect : Map k v -> Map k v -> Map k v
  base.Map.intersect = intersectWith (_ v -> v)

base.Map.intersectWith

.> view base.Map.intersectWith

  base.Map.intersectWith :
    (v -> v -> v2) -> Map k v -> Map k v -> Map k v2
  base.Map.intersectWith f m1 m2 =
    match (m1, m2) with
      (Map k1 v1, Map k2 v2) ->
        go i j ko vo =
          use List at
          match (at i k1, at j k2) with
            (None, _)          -> Map ko vo
            (_, None)          -> Map ko vo
            (Some kx, Some ky) ->
              if kx == ky then
                use Nat +
                go
                  (i + 1)
                  (j + 1)
                  (ko :+ kx)
                  (vo :+ f (unsafeAt i v1) (unsafeAt j v2))
              else
                if kx < ky then
                  i' = lubIndexOf' ky i k1
                  go i' j ko vo
                else
                  j' = lubIndexOf' kx j k2
                  go i j' ko vo
        go 0 0 [] []

base.Map.keys

.> view base.Map.keys

  base.Map.keys : Map k v -> [k]
  base.Map.keys = cases Map ks _ -> ks

base.Map.lookup

.> view base.Map.lookup

  base.Map.lookup : k -> Map k v -> Optional v
  base.Map.lookup k = cases
    Map ks vs ->
      match anyIndexOf k ks with
        None   -> None
        Some i -> List.at i vs

base.Map.map

.> view base.Map.map

  base.Map.map : (v ->{𝕖} v2) -> Map k v ->{𝕖} Map k v2
  base.Map.map f m = Map (keys m) (List.map f (values m))

base.Map.mapKeys

.> view base.Map.mapKeys

  base.Map.mapKeys : (k ->{𝕖} k2) -> Map k v ->{𝕖} Map k2 v
  base.Map.mapKeys f m = Map (List.map f (keys m)) (values m)

base.Map.singleton

.> view base.Map.singleton

  base.Map.singleton : k -> v -> Map k v
  base.Map.singleton k v = Map [k] [v]

base.Map.size

.> view base.Map.size

  base.Map.size : Map k v -> Nat
  base.Map.size s = List.size (keys s)

base.Map.toList

.> view base.Map.toList

  base.Map.toList : Map k v -> [(k, v)]
  base.Map.toList m = zip (keys m) (values m)

base.Map.union

.> view base.Map.union

  base.Map.union : Map k v -> Map k v -> Map k v
  base.Map.union = Map.unionWith (_ v -> v)

base.Map.unionWith

.> view base.Map.unionWith

  base.Map.unionWith :
    (v ->{𝕖} v ->{𝕖} v) -> Map k v -> Map k v ->{𝕖} Map k v
  base.Map.unionWith f m1 m2 =
    match (m1, m2) with
      (Map k1 v1, Map k2 v2) ->
        go i j ko vo =
          use List ++ at drop
          match (at i k1, at j k2) with
            (None, _)          ->
              Map (ko ++ drop j k2) (vo ++ drop j v2)
            (_, None)          ->
              Map (ko ++ drop i k1) (vo ++ drop i v1)
            (Some kx, Some ky) ->
              if kx == ky then
                use Nat +
                go
                  (i + 1)
                  (j + 1)
                  (ko :+ kx)
                  (vo :+ f (unsafeAt i v1) (unsafeAt j v2))
              else
                if kx < ky then
                  i' = lubIndexOf' ky i k1
                  go
                    i'
                    j
                    (ko ++ slice i i' k1)
                    (vo ++ slice i i' v1)
                else
                  j' = lubIndexOf' kx j k2
                  go
                    i
                    j'
                    (ko ++ slice j j' k2)
                    (vo ++ slice j j' v2)
        go 0 0 [] []

base.Map.values

.> view base.Map.values

  base.Map.values : Map k v -> [v]
  base.Map.values = cases Map _ vs -> vs

base.Multimap.insert

.> view base.Multimap.insert

  base.Multimap.insert : k -> v -> Map k [v] -> Map k [v]
  base.Multimap.insert k v m =
    use Map insert
    match Map.lookup k m with
      None    -> insert k [v] m
      Some vs -> insert k (vs :+ v) m

base.Multimap.lookup

.> view base.Multimap.lookup

  base.Multimap.lookup : k -> Map k [v] -> [v]
  base.Multimap.lookup k m = orDefault [] (Map.lookup k m)

base.Nat

.> view base.Nat

  -- base.Nat is built-in.

base.Nat.*

.> view base.Nat.*

  -- base.Nat.* is built-in.

base.Nat.+

.> view base.Nat.+

  -- base.Nat.+ is built-in.

base.Nat.-

.> view base.Nat.-

  (base.Nat.-) : Nat -> Nat -> Int
  (base.Nat.-) = sub

base.Nat./

.> view base.Nat./

  -- base.Nat./ is built-in.

base.Nat.and

.> view base.Nat.and

  -- base.Nat.and is built-in.

base.Nat.complement

.> view base.Nat.complement

  -- base.Nat.complement is built-in.

base.Nat.decrement

.> view base.Nat.decrement

  base.Nat.decrement : Nat -> Nat
  base.Nat.decrement n = Nat.drop n 1

base.Nat.decrement.test

.> view base.Nat.decrement.test

  base.Nat.decrement.test : [Result]
  base.Nat.decrement.test =
    use Nat +
    forAll 100 Domain.nats (n -> Nat.decrement (n + 1) == n)

base.Nat.drop

.> view base.Nat.drop

  -- base.Nat.drop is built-in.

base.Nat.eq

.> view base.Nat.eq

  -- base.Nat.eq is built-in.

base.Nat.fromText

.> view base.Nat.fromText

  -- base.Nat.fromText is built-in.

base.Nat.gt

.> view base.Nat.gt

  -- base.Nat.gt is built-in.

base.Nat.gteq

.> view base.Nat.gteq

  -- base.Nat.gteq is built-in.

base.Nat.inRange

.> view base.Nat.inRange

  base.Nat.inRange : Nat -> Nat -> Nat -> Boolean
  base.Nat.inRange fromInclusive toExclusive x =
    (x >= fromInclusive) && (x < toExclusive)

base.Nat.inRange.test

.> view base.Nat.inRange.test

  base.Nat.inRange.test : [Result]
  base.Nat.inRange.test =
    runs
      100
      'let
        x = !nat
        y = !nat
        z = !nat
        match sort [x, y, z] with
          [x, y, z] -> expect ((Nat.inRange x z y) || (z == y))

base.Nat.increment

.> view base.Nat.increment

  -- base.Nat.increment is built-in.

base.Nat.isEven

.> view base.Nat.isEven

  -- base.Nat.isEven is built-in.

base.Nat.isOdd

.> view base.Nat.isOdd

  -- base.Nat.isOdd is built-in.

base.Nat.leadingZeros

.> view base.Nat.leadingZeros

  -- base.Nat.leadingZeros is built-in.

base.Nat.lt

.> view base.Nat.lt

  -- base.Nat.lt is built-in.

base.Nat.lteq

.> view base.Nat.lteq

  -- base.Nat.lteq is built-in.

base.Nat.maxNat

.> view base.Nat.maxNat

  base.Nat.maxNat : Nat
  base.Nat.maxNat = 18446744073709551615

base.Nat.mod

.> view base.Nat.mod

  -- base.Nat.mod is built-in.

base.Nat.or

.> view base.Nat.or

  -- base.Nat.or is built-in.

base.Nat.pow

.> view base.Nat.pow

  -- base.Nat.pow is built-in.

base.Nat.shiftLeft

.> view base.Nat.shiftLeft

  -- base.Nat.shiftLeft is built-in.

base.Nat.shiftRight

.> view base.Nat.shiftRight

  -- base.Nat.shiftRight is built-in.

base.Nat.sub

.> view base.Nat.sub

  -- base.Nat.sub is built-in.

base.Nat.toFloat

.> view base.Nat.toFloat

  -- base.Nat.toFloat is built-in.

base.Nat.toInt

.> view base.Nat.toInt

  -- base.Nat.toInt is built-in.

base.Nat.toText

.> view base.Nat.toText

  -- base.Nat.toText is built-in.

base.Nat.trailingZeros

.> view base.Nat.trailingZeros

  -- base.Nat.trailingZeros is built-in.

base.Nat.xor

.> view base.Nat.xor

  -- base.Nat.xor is built-in.

base.Optional

.> view base.Optional

  type base.Optional a = None | Some a

base.Optional.None

.> view base.Optional.None

  type base.Optional a = None | Some a

base.Optional.Some

.> view base.Optional.Some

  type base.Optional a = None | Some a

base.Optional.flatMap

.> view base.Optional.flatMap

  base.Optional.flatMap :
    (a ->{𝕖} Optional b) -> Optional a ->{𝕖} Optional b
  base.Optional.flatMap f = cases
    None   -> None
    Some a -> f a

base.Optional.isNone

.> view base.Optional.isNone

  base.Optional.isNone : Optional a -> Boolean
  base.Optional.isNone = cases
    None -> true
    _    -> false

base.Optional.isSome

.> view base.Optional.isSome

  base.Optional.isSome : Optional a -> Boolean
  base.Optional.isSome = cases
    Some a -> true
    None   -> false

base.Optional.map

.> view base.Optional.map

  base.Optional.map : (a ->{𝕖} b) -> Optional a ->{𝕖} Optional b
  base.Optional.map f = cases
    None   -> None
    Some a -> Some (f a)

base.Optional.map2

.> view base.Optional.map2

  base.Optional.map2 :
    (a ->{𝕖} b ->{𝕖} c)
    -> Optional a
    -> Optional b
    ->{𝕖} Optional c
  base.Optional.map2 f oa ob =
    Optional.flatMap (a -> Optional.map (f a) ob) oa

base.Optional.orDefault

.> view base.Optional.orDefault

  base.Optional.orDefault : a -> Optional a -> a
  base.Optional.orDefault a = cases
    None   -> a
    Some a -> a

base.Optional.orElse

.> view base.Optional.orElse

  base.Optional.orElse : Optional a -> Optional a -> Optional a
  base.Optional.orElse a b =
    match a with
      None   -> b
      Some _ -> a

base.Optional.toAbort

.> view base.Optional.toAbort

  base.Optional.toAbort : Optional a ->{Abort} a
  base.Optional.toAbort = cases
    None   -> abort
    Some a -> a

base.Ordering

.> view base.Ordering

  unique type base.Ordering = Less | Equal | Greater

base.Ordering.Equal

.> view base.Ordering.Equal

  unique type base.Ordering = Less | Equal | Greater

base.Ordering.Greater

.> view base.Ordering.Greater

  unique type base.Ordering = Less | Equal | Greater

base.Ordering.Less

.> view base.Ordering.Less

  unique type base.Ordering = Less | Equal | Greater

base.Ordering.andThen

.> view base.Ordering.andThen

  base.Ordering.andThen : Ordering -> Ordering -> Ordering
  base.Ordering.andThen x y =
    match x with
      Equal -> y
      x     -> x

base.Ordering.andThen.example.ex1

.> view base.Ordering.andThen.example.ex1

  base.Ordering.andThen.example.ex1 : Ordering
  base.Ordering.andThen.example.ex1 =
    x = [5, 6, 7]
    y = [5, 9, 7, 6]
    Ordering.andThen
      (compareOn List.head x y) (compareOn List.last x y)

base.Request

.> view base.Request

  -- base.Request is built-in.

base.Search.anyIndexOf

.> view base.Search.anyIndexOf

  base.Search.anyIndexOf : a -> [a] -> Optional Nat
  base.Search.anyIndexOf a s =
    ao = Some a
    exact (i -> compare ao (List.at i s)) 0 (List.size s)

base.Search.anyIndexOf.evaluated.empty

.> view base.Search.anyIndexOf.evaluated.empty

  base.Search.anyIndexOf.evaluated.empty : Optional Nat
  base.Search.anyIndexOf.evaluated.empty = anyIndexOf 0 []

base.Search.anyIndexOf.evaluated.lower

.> view base.Search.anyIndexOf.evaluated.lower

  base.Search.anyIndexOf.evaluated.lower : Optional Nat
  base.Search.anyIndexOf.evaluated.lower =
    anyIndexOf 2 input.lower

base.Search.anyIndexOf.evaluated.notSorted

.> view base.Search.anyIndexOf.evaluated.notSorted

  base.Search.anyIndexOf.evaluated.notSorted : Optional Nat
  base.Search.anyIndexOf.evaluated.notSorted =
    anyIndexOf 1 input.lower

base.Search.anyIndexOf.evaluated.sorted

.> view base.Search.anyIndexOf.evaluated.sorted

  base.Search.anyIndexOf.evaluated.sorted : Optional Nat
  base.Search.anyIndexOf.evaluated.sorted =
    anyIndexOf 1 examples.elems

base.Search.anyIndexOf.evaluated.upper

.> view base.Search.anyIndexOf.evaluated.upper

  base.Search.anyIndexOf.evaluated.upper : Optional Nat
  base.Search.anyIndexOf.evaluated.upper =
    anyIndexOf 2 input.upper

base.Search.anyIndexOf.examples.input.lower

.> view base.Search.anyIndexOf.examples.input.lower

  base.Search.anyIndexOf.examples.input.lower : [Nat]
  base.Search.anyIndexOf.examples.input.lower = [1, 2, 1, 2, 1]

base.Search.anyIndexOf.examples.input.notSorted

.> view base.Search.anyIndexOf.examples.input.notSorted

  base.Search.anyIndexOf.examples.input.lower : [Nat]
  base.Search.anyIndexOf.examples.input.lower = [1, 2, 1, 2, 1]

base.Search.anyIndexOf.examples.input.sorted

.> view base.Search.anyIndexOf.examples.input.sorted

  base.List.last.examples.elems : [Nat]
  base.List.last.examples.elems = [1, 2, 3]

base.Search.anyIndexOf.examples.input.upper

.> view base.Search.anyIndexOf.examples.input.upper

  base.Search.anyIndexOf.examples.input.upper : [Nat]
  base.Search.anyIndexOf.examples.input.upper = [2, 1, 1, 2, 1]

base.Search.anyIndexOf.tests.empty

.> view base.Search.anyIndexOf.tests.empty

  base.Search.anyIndexOf.tests.empty : [Result]
  base.Search.anyIndexOf.tests.empty =
    check (anyIndexOf 0 [] == None)

base.Search.anyIndexOf.tests.lower

.> view base.Search.anyIndexOf.tests.lower

  base.Search.anyIndexOf.tests.lower : [Result]
  base.Search.anyIndexOf.tests.lower =
    check (anyIndexOf 2 input.lower == None)

base.Search.anyIndexOf.tests.notSorted

.> view base.Search.anyIndexOf.tests.notSorted

  base.Search.anyIndexOf.tests.notSorted : [Result]
  base.Search.anyIndexOf.tests.notSorted =
    check (anyIndexOf 1 input.lower == Some 2)

base.Search.anyIndexOf.tests.sorted

.> view base.Search.anyIndexOf.tests.sorted

  base.Search.anyIndexOf.tests.sorted : [Result]
  base.Search.anyIndexOf.tests.sorted =
    check (anyIndexOf 1 examples.elems == Some 0)

base.Search.anyIndexOf.tests.upper

.> view base.Search.anyIndexOf.tests.upper

  base.Search.anyIndexOf.tests.upper : [Result]
  base.Search.anyIndexOf.tests.upper =
    check (anyIndexOf 2 input.upper == None)

base.Search.elem

.> view base.Search.elem

  base.List.contains : a -> [a] -> Boolean
  base.List.contains a as = isSome <| indexOf a as

base.Search.elem.tests.negative1

.> view base.Search.elem.tests.negative1

  base.Search.elem.tests.negative1 : [Result]
  base.Search.elem.tests.negative1 = check (elem 0 [] == false)

base.Search.elem.tests.negative2

.> view base.Search.elem.tests.negative2

  base.Search.elem.tests.negative2 : [Result]
  base.Search.elem.tests.negative2 =
    check (elem 0 [1, 2, 3] == false)

base.Search.elem.tests.negative3

.> view base.Search.elem.tests.negative3

  base.Search.elem.tests.negative3 : [Result]
  base.Search.elem.tests.negative3 =
    check (elem 1 [0, 0, 0] == false)

base.Search.elem.tests.positive

.> view base.Search.elem.tests.positive

  base.List.contains.tests.prop1 : [Result]
  base.List.contains.tests.prop1 =
    go _ =
      use List ++
      a = !(listOf nat)
      b = !nat
      c = !(listOf nat)
      expect (elem b (a :+ b ++ c))
    runs 100 go

base.Search.exact

.> view base.Search.exact

  base.Search.exact :
    (Nat ->{𝕖} Int) -> Nat -> Nat ->{𝕖} Optional Nat
  base.Search.exact hit bot top =
    if bot >= top then None
    else
      use Nat +
      use base.Search exact
      mid =
        use Nat /
        bot + top / 2
      match hit mid with
        +0 -> Some mid
        -1 -> exact hit bot mid
        +1 -> exact hit (mid + 1) top

base.Search.indexOf

.> view base.Search.indexOf

  base.Search.indexOf : a -> [a] -> Optional Nat
  base.Search.indexOf a as =
    go : Nat -> [a] -> Optional Nat
    go index = cases
      []                       -> None
      head +: tail | head == a -> Some index
      _ +: tail                ->
        use Nat +
        go (index + 1) tail
    go 0 as

base.Search.indexOf.tests.negative1

.> view base.Search.indexOf.tests.negative1

  base.Search.indexOf.tests.negative1 : [Result]
  base.Search.indexOf.tests.negative1 =
    check (indexOf 0 [] == None)

base.Search.indexOf.tests.negative2

.> view base.Search.indexOf.tests.negative2

  base.Search.indexOf.tests.negative2 : [Result]
  base.Search.indexOf.tests.negative2 =
    check (indexOf 0 [1, 2, 3] == None)

base.Search.indexOf.tests.negative3

.> view base.Search.indexOf.tests.negative3

  base.Search.indexOf.tests.negative3 : [Result]
  base.Search.indexOf.tests.negative3 =
    check (indexOf 1 [0, 0, 0] == None)

base.Search.indexOf.tests.positive1

.> view base.Search.indexOf.tests.positive1

  base.Search.indexOf.tests.positive1 : [Result]
  base.Search.indexOf.tests.positive1 =
    check (indexOf 1 [1, 2, 3] == Some 0)

base.Search.indexOf.tests.positive2

.> view base.Search.indexOf.tests.positive2

  base.Search.indexOf.tests.positive2 : [Result]
  base.Search.indexOf.tests.positive2 =
    check (indexOf 3 [3, 1, 2, 3] == Some 0)

base.Search.indexOf.tests.positive3

.> view base.Search.indexOf.tests.positive3

  base.Search.indexOf.tests.positive3 : [Result]
  base.Search.indexOf.tests.positive3 =
    check (indexOf 1 [3, 1, 2, 3] == Some 1)

base.Search.lub

.> view base.Search.lub

  base.Search.lub : (Nat ->{𝕖} Int) -> Nat -> Nat ->{𝕖} Nat
  base.Search.lub hit bot top =
    if bot >= top then top
    else
      use Nat +
      use base.Search lub
      mid =
        use Nat /
        bot + top / 2
      match hit mid with
        +0 -> mid
        -1 -> lub hit bot mid
        +1 -> lub hit (mid + 1) top

base.Search.lubIndexOf

.> view base.Search.lubIndexOf

  base.Search.lubIndexOf : a -> [a] -> Nat
  base.Search.lubIndexOf a s = lubIndexOf' a 0 s

base.Search.lubIndexOf'

.> view base.Search.lubIndexOf'

  base.Search.lubIndexOf' : a -> Nat -> [a] -> Nat
  base.Search.lubIndexOf' a start s =
    ao = Some a
    lub (i -> compare ao (List.at i s)) start (List.size s)

base.Search.lubIndexOf.evaluated.empty

.> view base.Search.lubIndexOf.evaluated.empty

  base.Search.lubIndexOf.evaluated.empty : Nat
  base.Search.lubIndexOf.evaluated.empty = lubIndexOf 0 []

base.Search.lubIndexOf.evaluated.notSorted

.> view base.Search.lubIndexOf.evaluated.notSorted

  base.Search.lubIndexOf.evaluated.notSorted : Nat
  base.Search.lubIndexOf.evaluated.notSorted =
    lubIndexOf 3 [1, 3, 2, 1]

base.Search.lubIndexOf.evaluated.sorted

.> view base.Search.lubIndexOf.evaluated.sorted

  base.Search.lubIndexOf.evaluated.sorted : Nat
  base.Search.lubIndexOf.evaluated.sorted =
    lubIndexOf 1 [1, 2, 3]

base.Search.lubIndexOf.tests.empty

.> view base.Search.lubIndexOf.tests.empty

  base.Search.lubIndexOf.tests.empty : [Result]
  base.Search.lubIndexOf.tests.empty =
    check (lubIndexOf 0 [] == 0)

base.Search.lubIndexOf.tests.notSorted

.> view base.Search.lubIndexOf.tests.notSorted

  base.Search.lubIndexOf.tests.notSorted : [Result]
  base.Search.lubIndexOf.tests.notSorted =
    check (lubIndexOf 3 [1, 3, 2, 1] == 4)

base.Search.lubIndexOf.tests.sorted

.> view base.Search.lubIndexOf.tests.sorted

  base.Search.lubIndexOf.tests.sorted : [Result]
  base.Search.lubIndexOf.tests.sorted =
    check (lubIndexOf 1 [1, 2, 3] == 0)

base.Search.notElem

.> view base.Search.notElem

  base.Search.notElem : a -> [a] -> Boolean
  base.Search.notElem a as = not <| elem a as

base.Set

.> view base.Set

  type base.Set a = Set (Map a ())

base.Set.Set

.> view base.Set.Set

  type base.Set a = Set (Map a ())

base.Set.contains

.> view base.Set.contains

  base.Set.contains : k -> Set k -> Boolean
  base.Set.contains k = cases Set m -> Map.contains k m

base.Set.delete

.> view base.Set.delete

  base.Set.delete : k -> Set k -> Set k
  base.Set.delete k s = Set (Map.delete k (underlying s))

base.Set.delete.test

.> view base.Set.delete.test

  base.Set.delete.test : [Result]
  base.Set.delete.test =
    runs
      100 'let
        xs = !(setOf nat)
        x = !nat
        expect (not (Set.contains x (Set.delete x xs)))

base.Set.empty

.> view base.Set.empty

  base.Set.empty : Set k
  base.Set.empty = Set Map.empty

base.Set.flatMap

.> view base.Set.flatMap

  base.Set.flatMap : (a ->{e} Set b) -> Set a ->{e} Set b
  base.Set.flatMap f as =
    Set.foldl (b a -> Set.union b (f a)) Set.empty as

base.Set.flatMap.tests.associative

.> view base.Set.flatMap.tests.associative

  base.Set.flatMap.tests.associative : [Result]
  base.Set.flatMap.tests.associative =
    use Map lookup
    use Set empty
    runs
      100
      'let
        xs = !(setOf nat)
        ys = !(mapOf nat (setOf nat))
        zs = !(mapOf nat (setOf nat))
        f x = orDefault empty (lookup x ys)
        g y = orDefault empty (lookup y zs)
        r =
          use Set flatMap
             flatMap f (flatMap g xs)
          == flatMap (x -> flatMap f (g x)) xs
        expect r

base.Set.flatMap.tests.unit

.> view base.Set.flatMap.tests.unit

  base.Set.flatMap.tests.unit : [Result]
  base.Set.flatMap.tests.unit =
    use Set flatMap singleton
    runs
      100 'let
        n = !nat
        xs = !(setOf nat)
        ys = !(mapOf nat (setOf nat))
        f x = orDefault Set.empty (Map.lookup x ys)
        left = flatMap f (singleton n) == f n
        right = flatMap singleton xs == xs
        expect (left && right)

base.Set.flatten

.> view base.Set.flatten

  base.Set.flatten : Set (Set b) -> Set b
  base.Set.flatten = Set.flatMap id

base.Set.flatten.tests.associative

.> view base.Set.flatten.tests.associative

  base.Set.flatten.tests.associative : [Result]
  base.Set.flatten.tests.associative =
    use Set flatten
    runs
      100
      'let
        xs = !(setOf (setOf (setOf nat)))
        expect
          (flatten (flatten xs) == flatten (Set.map flatten xs))

base.Set.flatten.tests.unit

.> view base.Set.flatten.tests.unit

  base.Set.flatten.tests.unit : [Result]
  base.Set.flatten.tests.unit =
    use Set flatten singleton
    runs
      100
      'let
        xs = !(setOf nat)
        expect
          (   flatten (singleton xs)
          == flatten (Set.map singleton xs))

base.Set.foldl

.> view base.Set.foldl

  base.Set.foldl : (b ->{e} a ->{e} b) -> b -> Set a ->{e} b
  base.Set.foldl f b s = List.foldl f b (keys (underlying s))

base.Set.foldl.tests.homomorphism

.> view base.Set.foldl.tests.homomorphism

  base.Set.foldl.tests.homomorphism : [Result]
  base.Set.foldl.tests.homomorphism =
    runs
      100 'let
        xs = !(setOf nat)
        expect (Set.foldl (:+) [] xs == Set.toList xs)

base.Set.foldr

.> view base.Set.foldr

  base.Set.foldr : (a ->{e} b ->{e} b) -> b -> Set a ->{e} b
  base.Set.foldr f b s = List.foldr f b (keys (underlying s))

base.Set.foldr.tests.homomorphism

.> view base.Set.foldr.tests.homomorphism

  base.Set.foldr.tests.homomorphism : [Result]
  base.Set.foldr.tests.homomorphism =
    runs
      100 'let
        xs = !(setOf nat)
        expect (Set.foldr (+:) [] xs == Set.toList xs)

base.Set.fromList

.> view base.Set.fromList

  base.Set.fromList : [k] -> Set k
  base.Set.fromList ks =
    Set (Map.fromList (List.map (k -> (k, ())) ks))

base.Set.insert

.> view base.Set.insert

  base.Set.insert : k -> Set k -> Set k
  base.Set.insert k = cases Set s -> Set (!(Map.insert k) s)

base.Set.intersect

.> view base.Set.intersect

  base.Set.intersect : Set k -> Set k -> Set k
  base.Set.intersect s1 s2 =
    Set (Map.intersect (underlying s1) (underlying s2))

base.Set.map

.> view base.Set.map

  base.Set.map : (a ->{e} b) -> Set a ->{e} Set b
  base.Set.map f s = Set (Map.mapKeys f (underlying s))

base.Set.map.test

.> view base.Set.map.test

  base.Set.map.test : [Result]
  base.Set.map.test =
    use Set map
    runs
      100 'let
        ks = !(setOf nat)
        f x =
          use Nat *
          x * 2
        g x =
          use Nat +
          x + 2
        expect (map ( f g) ks == map f (map g ks))

base.Set.singleton

.> view base.Set.singleton

  base.Set.singleton : a -> Set a
  base.Set.singleton a = Set.insert a Set.empty

base.Set.singleton.test

.> view base.Set.singleton.test

  base.Set.singleton.test : [Result]
  base.Set.singleton.test =
    check
      let
        s = Set.singleton 0
        (Set.contains 0 s) && (Set.size s == 1)

base.Set.size

.> view base.Set.size

  base.Set.size : Set k -> Nat
  base.Set.size s = Map.size (underlying s)

base.Set.toList

.> view base.Set.toList

  base.Set.toList : Set k -> [k]
  base.Set.toList = cases Set (Map ks _) -> ks

base.Set.toMap

.> view base.Set.toMap

  base.Set.toMap : (k ->{𝕖} v) -> Set k ->{𝕖} Map k v
  base.Set.toMap f = cases
    Set (Map ks vs) -> Map ks (List.map f ks)

base.Set.underlying

.> view base.Set.underlying

  base.Set.underlying : Set k -> Map k ()
  base.Set.underlying = cases Set s -> s

base.Set.union

.> view base.Set.union

  base.Set.union : Set k -> Set k -> Set k
  base.Set.union s1 s2 =
    Set (Map.union (underlying s1) (underlying s2))

base.Set.unions

.> view base.Set.unions

  base.Set.unions : [Set a] -> Set a
  base.Set.unions = List.foldl Set.union Set.empty

base.Set.unions.test

.> view base.Set.unions.test

  base.Set.unions.test : [Result]
  base.Set.unions.test =
    runs
      100 'let
        sets = !(listOf (setOf nat))
        expect (unions sets == Set.flatten (Set.fromList sets))

base.Store

.> view base.Store

  ability base.Store a where
    put : a ->{base.Store a} ()
    get : {base.Store a} a

base.Store.get

.> view base.Store.get

  ability base.Store a where
    put : a ->{base.Store a} ()
    get : {base.Store a} a

base.Store.get.examples.ex1

.> view base.Store.get.examples.ex1

  base.Store.get.examples.ex1 : Nat
  base.Store.get.examples.ex1 = withInitialValue 1 'get

base.Store.local

.> view base.Store.local

  base.Store.local : a -> '{g, Store a} v ->{g, Store a} v
  base.Store.local a op =
    old = get
    put a
    res = !op
    put old
    res

base.Store.local.examples.ex1

.> view base.Store.local.examples.ex1

  base.Store.local.examples.ex1 : (Nat, Nat, Nat)
  base.Store.local.examples.ex1 =
    withInitialValue
      1 'let
        before = get
        during = local 2 'get
        after = get
        (before, during, after)

base.Store.local.test

.> view base.Store.local.test

  base.Store.local.test : [Result]
  base.Store.local.test =
    run (expect ((1, 2, 1) == local.examples.ex1))

base.Store.modify

.> view base.Store.modify

  base.Store.modify : (a ->{g} a) ->{g, Store a} ()
  base.Store.modify f = put (f get)

base.Store.modify.examples.increment

.> view base.Store.modify.examples.increment

  base.Store.modify.examples.increment : Nat
  base.Store.modify.examples.increment =
    use Nat +
    withInitialValue
      3 'let
        Store.modify (x -> x + 1)
        get

base.Store.modify.test

.> view base.Store.modify.test

  base.Store.modify.test : [Result]
  base.Store.modify.test =
    run (expect (4 == examples.increment))

base.Store.put

.> view base.Store.put

  ability base.Store a where
    put : a ->{base.Store a} ()
    get : {base.Store a} a

base.Store.put.examples.ex1

.> view base.Store.put.examples.ex1

  base.Store.put.examples.ex1 : Nat
  base.Store.put.examples.ex1 =
    withInitialValue
      10 'let
        put 15
        get

base.Store.withInitialValue

.> view base.Store.withInitialValue

  base.Store.withInitialValue : a -> '{g, Store a} v ->{g} v
  base.Store.withInitialValue init thunk =
    handle !thunk with withInitialValue.handler init

base.Store.withInitialValue.handler

.> view base.Store.withInitialValue.handler

  base.Store.withInitialValue.handler :
    a -> Request (Store a) v -> v
  base.Store.withInitialValue.handler init = cases
    { v }        -> v
    {get -> k}   ->
      handle k init
      with base.Store.withInitialValue.handler init
    {put v -> k} ->
      handle !k with base.Store.withInitialValue.handler v

base.Store.withInitialValue.laws.law1

.> view base.Store.withInitialValue.laws.law1

  base.Store.withInitialValue.laws.law1 : a ->{Store a} Test
  base.Store.withInitialValue.laws.law1 v =
    expect
      (v == let
        put v
        get)

base.Store.withInitialValue.tests.law1

.> view base.Store.withInitialValue.tests.law1

  base.Store.withInitialValue.tests.law1 : [Result]
  base.Store.withInitialValue.tests.law1 =
    runs
      20
      'let
        vs = !(listOf nat)
        tests
          (withInitialValue
            0 '(expect (get == 0) +: List.map laws.law1 vs))

base.Stream

.> view base.Stream

  ability base.Stream e where emit : e ->{base.Stream e} ()

base.Stream.emit

.> view base.Stream.emit

  ability base.Stream e where emit : e ->{base.Stream e} ()

base.Stream.range

.> view base.Stream.range

  base.Stream.range : Nat -> Nat ->{Stream Nat} ()
  base.Stream.range n m =
    if n >= m then ()
    else
      use Nat +
      emit n
      base.Stream.range (n + 1) m

base.Stream.tests.ex1

.> view base.Stream.tests.ex1

  base.Stream.tests.ex1 : [Result]
  base.Stream.tests.ex1 =
    check (Stream.toList '(Stream.range 0 5) == [0, 1, 2, 3, 4])

base.Stream.toList

.> view base.Stream.toList

  base.Stream.toList : '{e, Stream a} () ->{e} [a]
  base.Stream.toList s = handle !s with toList.handler

base.Stream.toList.handler

.> view base.Stream.toList.handler

  base.Stream.toList.handler : Request {Stream a} () -> [a]
  base.Stream.toList.handler =
    h : [a] -> Request {Stream a} () -> [a]
    h acc = cases
      {emit e -> resume} ->
        handle !resume
        with
          use List ++
          h (acc ++ [e])
      { u }              -> acc
    h []

base.Test.Result

.> view base.Test.Result

  unique type base.Test.Result = Result.Fail Text | Ok Text

base.Test.Result.Fail

.> view base.Test.Result.Fail

  unique type base.Test.Result = Result.Fail Text | Ok Text

base.Test.Result.Ok

.> view base.Test.Result.Ok

  unique type base.Test.Result = Result.Fail Text | Ok Text

base.Text

.> view base.Text

  -- base.Text is built-in.

base.Text.!=

.> view base.Text.!=

  -- base.Text.!= is built-in.

base.Text.++

.> view base.Text.++

  -- base.Text.++ is built-in.

base.Text.drop

.> view base.Text.drop

  -- base.Text.drop is built-in.

base.Text.empty

.> view base.Text.empty

  -- base.Text.empty is built-in.

base.Text.eq

.> view base.Text.eq

  -- base.Text.eq is built-in.

base.Text.fromCharList

.> view base.Text.fromCharList

  -- base.Text.fromCharList is built-in.

base.Text.gt

.> view base.Text.gt

  -- base.Text.gt is built-in.

base.Text.gteq

.> view base.Text.gteq

  -- base.Text.gteq is built-in.

base.Text.lt

.> view base.Text.lt

  -- base.Text.lt is built-in.

base.Text.lteq

.> view base.Text.lteq

  -- base.Text.lteq is built-in.

base.Text.size

.> view base.Text.size

  -- base.Text.size is built-in.

base.Text.split

.> view base.Text.split

  base.Text.split : Char -> Text -> [Text]
  base.Text.split separator text =
    go acc rest =
      match indexOf separator rest with
        None   -> acc :+ fromCharList rest
        Some n ->
          use Nat +
          go
            (acc :+ fromCharList (List.take n rest))
            (List.drop (n + 1) rest)
    if text == "" then [] else go [] (toCharList text)

base.Text.split.examples.ex1

.> view base.Text.split.examples.ex1

  base.Text.split.examples.ex1 : [Text]
  base.Text.split.examples.ex1 = Text.split ?. "foo.bar.baz"

base.Text.split.examples.ex2

.> view base.Text.split.examples.ex2

  base.Text.split.examples.ex2 : [Text]
  base.Text.split.examples.ex2 = Text.split ?. ""

base.Text.split.test

.> view base.Text.split.test

  base.Text.split.test : [Result]
  base.Text.split.test =
    use Text ++
    runs
      100
      'let
        x =
          fromCharList
            (Nonempty.toList !(atLeastOne (oneOf [?., ?-])))
        expect
          (   List.foldl (++) "" (intersperse "." (Text.split ?. x))
          == x)

base.Text.take

.> view base.Text.take

  -- base.Text.take is built-in.

base.Text.toCharList

.> view base.Text.toCharList

  -- base.Text.toCharList is built-in.

base.Text.uncons

.> view base.Text.uncons

  -- base.Text.uncons is built-in.

base.Text.unsnoc

.> view base.Text.unsnoc

  -- base.Text.unsnoc is built-in.

base.Trie

.> view base.Trie

  type base.Trie k v = Trie (Optional v) (Map k (base.Trie k v))

base.Trie.Trie

.> view base.Trie.Trie

  type base.Trie k v = Trie (Optional v) (Map k (base.Trie k v))

base.Trie.empty

.> view base.Trie.empty

  base.Trie.empty : Trie k v
  base.Trie.empty = Trie None Map.empty

base.Trie.head

.> view base.Trie.head

  base.Trie.head : Trie k v -> Optional v
  base.Trie.head = cases Trie head _ -> head

base.Trie.head.modify

.> view base.Trie.head.modify

  base.Trie.head.modify :
    (Optional v ->{𝕖} Optional v) -> Trie k v ->{𝕖} Trie k v
  base.Trie.head.modify f = cases
    Trie head tail -> Trie (f head) tail

base.Trie.head.set

.> view base.Trie.head.set

  base.Trie.head.set : Optional v -> Trie k v -> Trie k v
  base.Trie.head.set head1 = cases
    Trie _ tail -> Trie head1 tail

base.Trie.insert

.> view base.Trie.insert

  base.Trie.insert : [k] -> v -> Trie k v -> Trie k v
  base.Trie.insert path v t =
    Trie.unionWith const (Trie.singleton path v) t

base.Trie.lookup

.> view base.Trie.lookup

  base.Trie.lookup : [k] -> Trie k v -> Optional v
  base.Trie.lookup path t =
    match path with
      []      -> Trie.head t
      p +: ps ->
        Optional.flatMap
          (base.Trie.lookup ps) (Map.lookup p (Trie.tail t))

base.Trie.map

.> view base.Trie.map

  base.Trie.map : (v1 -> v2) -> Trie k v1 -> Trie k v2
  base.Trie.map f t =
    Trie
      (Optional.map f (Trie.head t))
      (Map.map (base.Trie.map f) (Trie.tail t))

base.Trie.mapKeys

.> view base.Trie.mapKeys

  base.Trie.mapKeys : (k1 -> k2) -> Trie k1 v -> Trie k2 v
  base.Trie.mapKeys f t =
    Trie
      (Trie.head t)
      (Map.mapKeys
        f (Map.map (base.Trie.mapKeys f) (Trie.tail t)))

base.Trie.singleton

.> view base.Trie.singleton

  base.Trie.singleton : [k] -> v -> Trie k v
  base.Trie.singleton path v =
    match path with
      []      -> Trie (Some v) Map.empty
      k +: ks ->
        Trie None (Map.fromList [(k, base.Trie.singleton ks v)])

base.Trie.tail

.> view base.Trie.tail

  base.Trie.tail : Trie k v -> Map k (Trie k v)
  base.Trie.tail = cases Trie _ tail -> tail

base.Trie.tail.modify

.> view base.Trie.tail.modify

  base.Trie.tail.modify :
    (Map k111 (Trie k111 v) ->{𝕖} Map k (Trie k v))
    -> Trie k111 v
    ->{𝕖} Trie k v
  base.Trie.tail.modify f = cases
    Trie head tail -> Trie head (f tail)

base.Trie.tail.set

.> view base.Trie.tail.set

  base.Trie.tail.set :
    Map k (Trie k v) -> Trie k111 v -> Trie k v
  base.Trie.tail.set tail1 = cases
    Trie head _ -> Trie head tail1

base.Trie.union

.> view base.Trie.union

  base.Trie.union : Trie k v ->{𝕖} Trie k v ->{𝕖} Trie k v
  base.Trie.union = Trie.unionWith const

base.Trie.unionWith

.> view base.Trie.unionWith

  base.Trie.unionWith :
    (v -> v -> v) -> Trie k v -> Trie k v -> Trie k v
  base.Trie.unionWith f t1 t2 =
    use Trie head tail
    h1 = head t1
    h2 = head t2
    Trie
      (orElse (orElse (map2 f h1 h2) h1) h2)
      (Map.unionWith (base.Trie.unionWith f) (tail t1) (tail t2))

base.Tuple

.> view base.Tuple

  type base.Tuple a b = Cons a b

base.Tuple.Cons

.> view base.Tuple.Cons

  type base.Tuple a b = Cons a b

base.Tuple.at1

.> view base.Tuple.at1

  base.Tuple.at1 : Tuple a b -> a
  base.Tuple.at1 = cases Cons a _ -> a

base.Tuple.at1.tests.ex1

.> view base.Tuple.at1.tests.ex1

  base.Tuple.at1.tests.ex1 : [Result]
  base.Tuple.at1.tests.ex1 = check (at1 ("A", "B") == "A")

base.Tuple.at2

.> view base.Tuple.at2

  base.Tuple.at2 : Tuple a (Tuple b c) -> b
  base.Tuple.at2 = cases Cons _ (Cons b _) -> b

base.Tuple.at2.tests.ex1

.> view base.Tuple.at2.tests.ex1

  base.Tuple.at2.tests.ex1 : [Result]
  base.Tuple.at2.tests.ex1 = check (at2 ("A", "B") == "B")

base.Tuple.at3

.> view base.Tuple.at3

  base.Tuple.at3 : Tuple a (Tuple b (Tuple c d)) -> c
  base.Tuple.at3 = cases Cons _ (Cons _ (Cons c _)) -> c

base.Tuple.at3.tests.ex1

.> view base.Tuple.at3.tests.ex1

  base.Tuple.at3.tests.ex1 : [Result]
  base.Tuple.at3.tests.ex1 = check (at3 ("A", "B", "C") == "C")

base.Tuple.at3.tests.ex2

.> view base.Tuple.at3.tests.ex2

  base.Tuple.at3.tests.ex2 : [Result]
  base.Tuple.at3.tests.ex2 =
    check (at3 ("A", "B", "C", "D") == "C")

base.Tuple.at4

.> view base.Tuple.at4

  base.Tuple.at4 : Tuple a (Tuple b (Tuple c (Tuple d e))) -> d
  base.Tuple.at4 = cases
    Cons _ (Cons _ (Cons _ (Cons d _))) -> d

base.Tuple.at4.tests.ex1

.> view base.Tuple.at4.tests.ex1

  base.Tuple.at4.tests.ex1 : [Result]
  base.Tuple.at4.tests.ex1 =
    check (at4 ("A", "B", "C", "D") == "D")

base.Tuple.at4.tests.ex2

.> view base.Tuple.at4.tests.ex2

  base.Tuple.at4.tests.ex2 : [Result]
  base.Tuple.at4.tests.ex2 =
    check (at4 ("A", "B", "C", "D", "E", "F") == "D")

base.Tuple.pair

.> view base.Tuple.pair

  base.Tuple.pair : a -> b -> (a, b)
  base.Tuple.pair a b = (a, b)

base.Tuple.tests.ex1

.> view base.Tuple.tests.ex1

  base.Tuple.tests.ex1 : [Result]
  base.Tuple.tests.ex1 =
    check
      let
        tuple : (Text, Nat, Text)
        tuple = ("Hello", 3, "Tuple")
        actual =
          use Text ++
          at1 tuple ++ Nat.toText (at2 tuple) ++ at3 tuple
        expected = "Hello3Tuple"
        actual == expected

base.Tuple.tests.ex2

.> view base.Tuple.tests.ex2

  base.Tuple.tests.ex2 : [Result]
  base.Tuple.tests.ex2 =
    check
      let
        pythagoras : (Nat, Nat, Nat)
        pythagoras = (3, 4, 5)
        square n =
          use Nat *
          n * n
        match pythagoras with
          (a, b, c) ->
            use Nat +
            square a + square b == square c

base.Unit

.> view base.Unit

  type base.Unit = Unit

base.Unit.Unit

.> view base.Unit.Unit

  type base.Unit = Unit

base.Universal.!=

.> view base.Universal.!=

  (base.Universal.!=) : a -> a -> Boolean
  a base.Universal.!= b = not (a == b)

base.Universal.<

.> view base.Universal.<

  -- base.Universal.< is built-in.

base.Universal.<=

.> view base.Universal.<=

  -- base.Universal.<= is built-in.

base.Universal.==

.> view base.Universal.==

  -- base.Universal.== is built-in.

base.Universal.>

.> view base.Universal.>

  -- base.Universal.> is built-in.

base.Universal.>=

.> view base.Universal.>=

  -- base.Universal.>= is built-in.

base.Universal.compare

.> view base.Universal.compare

  -- base.Universal.compare is built-in.

base.Universal.compareOn

.> view base.Universal.compareOn

  base.Universal.compareOn : (a ->{e} x) -> a -> a ->{e} Ordering
  base.Universal.compareOn p x y = on ordering p x y

base.Universal.max

.> view base.Universal.max

  base.Universal.max : a -> a -> a
  base.Universal.max a b = if a > b then a else b

base.Universal.max.tests.absorption

.> view base.Universal.max.tests.absorption

  base.Universal.max.tests.absorption : [Result]
  base.Universal.max.tests.absorption =
    use Universal min
    runs 100 '(laws.absorption int min min)

base.Universal.max.tests.associative

.> view base.Universal.max.tests.associative

  base.Universal.max.tests.associative : [Result]
  base.Universal.max.tests.associative =
    runs 100 '(laws.associative int Universal.max)

base.Universal.max.tests.commutative

.> view base.Universal.max.tests.commutative

  base.Universal.max.tests.commutative : [Result]
  base.Universal.max.tests.commutative =
    runs 100 '(laws.commutative int Universal.max)

base.Universal.max.tests.distributesOverMin

.> view base.Universal.max.tests.distributesOverMin

  base.Universal.max.tests.distributesOverMin : [Result]
  base.Universal.max.tests.distributesOverMin =
    runs 100 '(distributive nat Universal.min Universal.max)

base.Universal.max.tests.idempotent

.> view base.Universal.max.tests.idempotent

  base.Universal.max.tests.idempotent : [Result]
  base.Universal.max.tests.idempotent =
    runs 100 '(idempotence int Universal.max)

base.Universal.max.tests.partialOrder

.> view base.Universal.max.tests.partialOrder

  base.Universal.max.tests.partialOrder : [Result]
  base.Universal.max.tests.partialOrder =
    runs
      100 'let
        x = !int
        y = !int
        expect (x >= y == (Universal.max x y == x))

base.Universal.min

.> view base.Universal.min

  base.Universal.min : a -> a -> a
  base.Universal.min a b = if a < b then a else b

base.Universal.min.tests.absorption

.> view base.Universal.min.tests.absorption

  base.Universal.min.tests.absorption : [Result]
  base.Universal.min.tests.absorption =
    runs 100 '(laws.absorption int Universal.min Universal.max)

base.Universal.min.tests.associative

.> view base.Universal.min.tests.associative

  base.Universal.min.tests.associative : [Result]
  base.Universal.min.tests.associative =
    runs 100 '(laws.associative int Universal.min)

base.Universal.min.tests.commutative

.> view base.Universal.min.tests.commutative

  base.Universal.min.tests.commutative : [Result]
  base.Universal.min.tests.commutative =
    runs 100 '(laws.commutative int Universal.min)

base.Universal.min.tests.distributesOverMax

.> view base.Universal.min.tests.distributesOverMax

  base.Universal.min.tests.distributesOverMax : [Result]
  base.Universal.min.tests.distributesOverMax =
    runs 100 '(distributive nat Universal.max Universal.min)

base.Universal.min.tests.idempotent

.> view base.Universal.min.tests.idempotent

  base.Universal.min.tests.idempotent : [Result]
  base.Universal.min.tests.idempotent =
    runs 100 '(idempotence int Universal.min)

base.Universal.min.tests.partialOrder

.> view base.Universal.min.tests.partialOrder

  base.Universal.min.tests.partialOrder : [Result]
  base.Universal.min.tests.partialOrder =
    runs
      100 'let
        x = !int
        y = !int
        expect (x <= y == (Universal.min x y == x))

base.Universal.ordering

.> view base.Universal.ordering

  base.Universal.ordering : a -> a -> Ordering
  base.Universal.ordering x y =
    c = compare x y
    if c < +0 then Less else if c == +0 then Equal else Greater

base.Universal.ordering.doc.snippet1

.> view base.Universal.ordering.doc.snippet1

  base.Universal.ordering.doc.snippet1 : Doc
  base.Universal.ordering.doc.snippet1 =
    [: @Less means the first object is below the second, @Equal means they are the same, and @Greater means the second object is below the first.
    
    Examples:
    
      @ordering 1 2
      > @Less
    
      @ordering 2 1
      > @Greater
    
      @ordering 4 4
      > @Equal
     :]

base.Void

.> view base.Void

  type base.Void = 

base.Weighted

.> view base.Weighted

  type base.Weighted a
    = Weight Nat 'base.Weighted a
    | Yield a (base.Weighted a)
    | Weighted.Fail

base.Weighted.<|>

.> view base.Weighted.<|>

  (base.Weighted.<|>) : Weighted a -> Weighted a -> Weighted a
  m base.Weighted.<|> n =
    use Weighted Fail
    use base.Weighted <|>
    match (m, n) with
      (Fail, n)                 -> n
      (Yield x m, n)            -> Yield x (m <|> n)
      (Weight w m, Fail)        -> Weight w m
      (Weight w m, Yield x n)   -> Yield x (Weight w m <|> n)
      (Weight w m, Weight w' n) ->
        use Nat drop
        if w < w' then Weight w '(!m <|> Weight (drop w' w) n)
        else
          if w == w' then Weight w '(!m <|> !n)
          else Weight w '(Weight (drop w w') m <|> !n)

base.Weighted.Fail

.> view base.Weighted.Fail

  type base.Weighted a
    = Weight Nat 'base.Weighted a
    | Yield a (base.Weighted a)
    | Weighted.Fail

base.Weighted.Weight

.> view base.Weighted.Weight

  type base.Weighted a
    = Weight Nat 'base.Weighted a
    | Yield a (base.Weighted a)
    | Weighted.Fail

base.Weighted.Yield

.> view base.Weighted.Yield

  type base.Weighted a
    = Weight Nat 'base.Weighted a
    | Yield a (base.Weighted a)
    | Weighted.Fail

base.Weighted.append

.> view base.Weighted.append

  base.Weighted.append : Weighted a -> Weighted a -> Weighted a
  base.Weighted.append w1 w2 =
    use base.Weighted append
    match w1 with
      Weight n k    -> Weight n '(append !k w2)
      Yield a k     -> Yield a (append k w2)
      Weighted.Fail -> w2

base.Weighted.append.examples.ex

.> view base.Weighted.append.examples.ex

  base.Weighted.append.examples.ex : [Nat]
  base.Weighted.append.examples.ex =
    use Weighted fromList
    Weighted.sample
      10
      (Weighted.append (fromList [1, 2, 3]) (fromList [4, 5, 6]))

base.Weighted.flatMap

.> view base.Weighted.flatMap

  base.Weighted.flatMap :
    (a -> Weighted b) -> Weighted a -> Weighted b
  base.Weighted.flatMap f = cases
    Weighted.Fail -> Weighted.Fail
    Yield x m     -> f x <|> base.Weighted.flatMap f m
    Weight w m    -> Weight w '(base.Weighted.flatMap f !m)

base.Weighted.fromList

.> view base.Weighted.fromList

  base.Weighted.fromList : [a] -> Weighted a
  base.Weighted.fromList = cases
    []      -> Weighted.Fail
    a +: as -> yield a <|> weight 1 '(base.Weighted.fromList as)

base.Weighted.ints

.> view base.Weighted.ints

  base.Weighted.ints : Weighted Int
  base.Weighted.ints =
    go n =
          yield n
      <|> weight
            1
            '(go
              (if n > +0 then negate n
              else Int.increment (negate n)))
        List.foldl
          (a n -> a <|> yield n)
          Weighted.Fail
          [+0, +1, -1, maxInt, minInt]
    <|> go +2

base.Weighted.lists

.> view base.Weighted.lists

  base.Weighted.lists : Weighted a -> Weighted [a]
  base.Weighted.lists w =
        yield []
    <|> weight 1 '(mergeWith (+:) w (base.Weighted.lists w))

base.Weighted.map

.> view base.Weighted.map

  base.Weighted.map : (a ->{e} b) -> Weighted a ->{e} Weighted b
  base.Weighted.map f = cases
    Weighted.Fail -> Weighted.Fail
    Yield x w     -> Yield (f x) (base.Weighted.map f w)
    Weight a w    -> weight a '(base.Weighted.map f !w)

base.Weighted.mergeWith

.> view base.Weighted.mergeWith

  base.Weighted.mergeWith :
    (a ->{𝕖} b ->{𝕖} c)
    -> Weighted a
    -> Weighted b
    ->{𝕖} Weighted c
  base.Weighted.mergeWith f as bs =
    Weighted.flatMap (a -> Weighted.map (b -> f a b) bs) as

base.Weighted.nats

.> view base.Weighted.nats

  base.Weighted.nats : Weighted Nat
  base.Weighted.nats =
    go n =
      use Nat +
      yield n <|> weight 1 '(go (n + 1))
    go 0

base.Weighted.sample

.> view base.Weighted.sample

  base.Weighted.sample : Nat -> Weighted a -> [a]
  base.Weighted.sample n wsa =
    if n > 0 then
      use base.Weighted sample
      match wsa with
        Weighted.Fail -> []
        Yield a ms    -> a +: sample (Nat.drop n 1) ms
        Weight _ w    -> sample n !w
    else []

base.Weighted.weight

.> view base.Weighted.weight

  base.Weighted.weight :
    Nat ->{e} '{e} Weighted a ->{e} Weighted a
  base.Weighted.weight w ws = Weight w ws

base.Weighted.yield

.> view base.Weighted.yield

  base.Weighted.yield : a -> Weighted a
  base.Weighted.yield a = Yield a Weighted.Fail

base.Year

.> view base.Year

  unique type base.Year = Year Nat

base.Year.Year

.> view base.Year.Year

  unique type base.Year = Year Nat

base.absurd

.> view base.absurd

  base.absurd : Void -> a
  base.absurd = cases 

base.absurdly

.> view base.absurdly

  base.absurdly : '{e} Void ->{e} a
  base.absurdly v = match !v with 

base.andThen

.> view base.andThen

  base.andThen : (a ->{𝕖} b) -> (b ->{𝕖} c) -> a ->{𝕖} c
  base.andThen f g x = g (f x)

base.bug

.> view base.bug

  -- base.bug is built-in.

base.const

.> view base.const

  base.const : a -> b -> a
  base.const a _ = a

base.force

.> view base.force

  base.force : '{e} a ->{e} a
  base.force op = !op

base.forever

.> view base.forever

  base.forever : '{e} a ->{e} b
  base.forever op =
    !op
    base.forever op

base.forever'

.> view base.forever'

  base.forever' : '{g} a -> '{g} b
  base.forever' a = '(forever a)

base.id

.> view base.id

  base.id : a -> a
  base.id a = a

base.ignore

.> view base.ignore

  base.ignore : a -> ()
  base.ignore _ = ()

base.io.BufferMode

.> view base.io.BufferMode

  unique type base.io.BufferMode = Line | Block (Optional Nat)

base.io.BufferMode.Block

.> view base.io.BufferMode.Block

  unique type base.io.BufferMode = Line | Block (Optional Nat)

base.io.BufferMode.Line

.> view base.io.BufferMode.Line

  unique type base.io.BufferMode = Line | Block (Optional Nat)

base.io.EpochTime

.> view base.io.EpochTime

  unique type base.io.EpochTime = EpochTime Nat

base.io.EpochTime.EpochTime

.> view base.io.EpochTime.EpochTime

  unique type base.io.EpochTime = EpochTime Nat

base.io.Error

.> view base.io.Error

  type base.io.Error = Error ErrorType Text

base.io.Error.Error

.> view base.io.Error.Error

  type base.io.Error = Error ErrorType Text

base.io.ErrorDescription

.> view base.io.ErrorDescription

  unique type base.io.ErrorDescription = ErrorDescription Text

base.io.ErrorDescription.ErrorDescription

.> view base.io.ErrorDescription.ErrorDescription

  unique type base.io.ErrorDescription = ErrorDescription Text

base.io.ErrorLocation

.> view base.io.ErrorLocation

  unique type base.io.ErrorLocation = ErrorLocation Text

base.io.ErrorLocation.ErrorLocation

.> view base.io.ErrorLocation.ErrorLocation

  unique type base.io.ErrorLocation = ErrorLocation Text

base.io.ErrorType

.> view base.io.ErrorType

  unique type base.io.ErrorType
    = AlreadyExists
    | NoSuchThing
    | ResourceBusy
    | ResourceExhausted
    | EOF
    | IllegalOperation
    | PermissionDenied
    | UserError

base.io.ErrorType.AlreadyExists

.> view base.io.ErrorType.AlreadyExists

  unique type base.io.ErrorType
    = AlreadyExists
    | NoSuchThing
    | ResourceBusy
    | ResourceExhausted
    | EOF
    | IllegalOperation
    | PermissionDenied
    | UserError

base.io.ErrorType.EOF

.> view base.io.ErrorType.EOF

  unique type base.io.ErrorType
    = AlreadyExists
    | NoSuchThing
    | ResourceBusy
    | ResourceExhausted
    | EOF
    | IllegalOperation
    | PermissionDenied
    | UserError

base.io.ErrorType.IllegalOperation

.> view base.io.ErrorType.IllegalOperation

  unique type base.io.ErrorType
    = AlreadyExists
    | NoSuchThing
    | ResourceBusy
    | ResourceExhausted
    | EOF
    | IllegalOperation
    | PermissionDenied
    | UserError

base.io.ErrorType.NoSuchThing

.> view base.io.ErrorType.NoSuchThing

  unique type base.io.ErrorType
    = AlreadyExists
    | NoSuchThing
    | ResourceBusy
    | ResourceExhausted
    | EOF
    | IllegalOperation
    | PermissionDenied
    | UserError

base.io.ErrorType.PermissionDenied

.> view base.io.ErrorType.PermissionDenied

  unique type base.io.ErrorType
    = AlreadyExists
    | NoSuchThing
    | ResourceBusy
    | ResourceExhausted
    | EOF
    | IllegalOperation
    | PermissionDenied
    | UserError

base.io.ErrorType.ResourceBusy

.> view base.io.ErrorType.ResourceBusy

  unique type base.io.ErrorType
    = AlreadyExists
    | NoSuchThing
    | ResourceBusy
    | ResourceExhausted
    | EOF
    | IllegalOperation
    | PermissionDenied
    | UserError

base.io.ErrorType.ResourceExhausted

.> view base.io.ErrorType.ResourceExhausted

  unique type base.io.ErrorType
    = AlreadyExists
    | NoSuchThing
    | ResourceBusy
    | ResourceExhausted
    | EOF
    | IllegalOperation
    | PermissionDenied
    | UserError

base.io.ErrorType.UserError

.> view base.io.ErrorType.UserError

  unique type base.io.ErrorType
    = AlreadyExists
    | NoSuchThing
    | ResourceBusy
    | ResourceExhausted
    | EOF
    | IllegalOperation
    | PermissionDenied
    | UserError

base.io.FilePath

.> view base.io.FilePath

  unique type base.io.FilePath = FilePath Text

base.io.FilePath.FilePath

.> view base.io.FilePath.FilePath

  unique type base.io.FilePath = FilePath Text

base.io.Handle

.> view base.io.Handle

  unique type base.io.Handle = Handle Text

base.io.Handle.Handle

.> view base.io.Handle.Handle

  unique type base.io.Handle = Handle Text

base.io.HostName

.> view base.io.HostName

  unique type base.io.HostName = HostName Text

base.io.HostName.HostName

.> view base.io.HostName.HostName

  unique type base.io.HostName = HostName Text

base.io.IO

.> view base.io.IO

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.accept_

.> view base.io.IO.accept_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.bracket_

.> view base.io.IO.bracket_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.clientSocket_

.> view base.io.IO.clientSocket_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.closeFile_

.> view base.io.IO.closeFile_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.closeSocket_

.> view base.io.IO.closeSocket_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.createDirectory_

.> view base.io.IO.createDirectory_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.delay_

.> view base.io.IO.delay_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.directoryContents_

.> view base.io.IO.directoryContents_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.fileExists_

.> view base.io.IO.fileExists_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.fork_

.> view base.io.IO.fork_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.getBuffering_

.> view base.io.IO.getBuffering_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.getCurrentDirectory_

.> view base.io.IO.getCurrentDirectory_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.getFileSize_

.> view base.io.IO.getFileSize_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.getFileTimestamp_

.> view base.io.IO.getFileTimestamp_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.getLine_

.> view base.io.IO.getLine_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.getTemporaryDirectory_

.> view base.io.IO.getTemporaryDirectory_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.getText_

.> view base.io.IO.getText_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.isDirectory_

.> view base.io.IO.isDirectory_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.isFileEOF_

.> view base.io.IO.isFileEOF_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.isFileOpen_

.> view base.io.IO.isFileOpen_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.isSeekable_

.> view base.io.IO.isSeekable_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.kill_

.> view base.io.IO.kill_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.listen_

.> view base.io.IO.listen_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.openFile_

.> view base.io.IO.openFile_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.position_

.> view base.io.IO.position_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.putText_

.> view base.io.IO.putText_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.receive_

.> view base.io.IO.receive_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.removeDirectory_

.> view base.io.IO.removeDirectory_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.removeFile_

.> view base.io.IO.removeFile_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.renameDirectory_

.> view base.io.IO.renameDirectory_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.renameFile_

.> view base.io.IO.renameFile_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.seek_

.> view base.io.IO.seek_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.send_

.> view base.io.IO.send_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.serverSocket_

.> view base.io.IO.serverSocket_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.setBuffering_

.> view base.io.IO.setBuffering_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.setCurrentDirectory_

.> view base.io.IO.setCurrentDirectory_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.systemTime_

.> view base.io.IO.systemTime_

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.IO.throw

.> view base.io.IO.throw

  ability base.io.IO where
    getFileSize_ : FilePath ->{base.io.IO} Either Error Nat
    kill_ : ThreadId ->{base.io.IO} Either Error ()
    send_ : Socket -> Bytes ->{base.io.IO} Either Error ()
    bracket_ :
      '{base.io.IO} a
      -> (a ->{base.io.IO} b)
      -> (a ->{base.io.IO} c)
      ->{base.io.IO} Either Error c
    getLine_ : Handle ->{base.io.IO} Either Error Text
    getText_ : Handle ->{base.io.IO} Either Error Text
    getFileTimestamp_ :
      FilePath ->{base.io.IO} Either Error EpochTime
    closeFile_ : Handle ->{base.io.IO} Either Error ()
    getTemporaryDirectory_ :
      {base.io.IO} (Either Error FilePath)
    getCurrentDirectory_ : {base.io.IO} (Either Error FilePath)
    renameDirectory_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    renameFile_ :
      FilePath -> FilePath ->{base.io.IO} Either Error ()
    receive_ :
      Socket -> Nat ->{base.io.IO} Either Error (Optional Bytes)
    fileExists_ : FilePath ->{base.io.IO} Either Error Boolean
    isDirectory_ : FilePath ->{base.io.IO} Either Error Boolean
    directoryContents_ :
      FilePath ->{base.io.IO} Either Error [FilePath]
    listen_ : Socket ->{base.io.IO} Either Error ()
    closeSocket_ : Socket ->{base.io.IO} Either Error ()
    clientSocket_ :
      HostName -> ServiceName ->{base.io.IO} Either Error Socket
    delay_ : Nat ->{base.io.IO} Either Error ()
    seek_ :
      Handle -> SeekMode -> Int ->{base.io.IO} Either Error ()
    serverSocket_ :
      Optional HostName
      -> ServiceName
      ->{base.io.IO} Either Error Socket
    accept_ : Socket ->{base.io.IO} Either Error Socket
    setBuffering_ :
      Handle
      -> Optional BufferMode
      ->{base.io.IO} Either Error ()
    openFile_ :
      FilePath -> Mode ->{base.io.IO} Either Error Handle
    throw : Error ->{base.io.IO} a
    fork_ : '{base.io.IO} a ->{base.io.IO} Either Error ThreadId
    getBuffering_ :
      Handle ->{base.io.IO} Either Error (Optional BufferMode)
    position_ : Handle ->{base.io.IO} Either Error Int
    setCurrentDirectory_ :
      FilePath ->{base.io.IO} Either Error ()
    createDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeDirectory_ : FilePath ->{base.io.IO} Either Error ()
    removeFile_ : FilePath ->{base.io.IO} Either Error ()
    systemTime_ : {base.io.IO} (Either Error EpochTime)
    isFileEOF_ : Handle ->{base.io.IO} Either Error Boolean
    isFileOpen_ : Handle ->{base.io.IO} Either Error Boolean
    isSeekable_ : Handle ->{base.io.IO} Either Error Boolean
    putText_ : Handle -> Text ->{base.io.IO} Either Error ()

base.io.Mode

.> view base.io.Mode

  type base.io.Mode = Read | Write | Append | ReadWrite

base.io.Mode.Append

.> view base.io.Mode.Append

  type base.io.Mode = Read | Write | Append | ReadWrite

base.io.Mode.Read

.> view base.io.Mode.Read

  type base.io.Mode = Read | Write | Append | ReadWrite

base.io.Mode.ReadWrite

.> view base.io.Mode.ReadWrite

  type base.io.Mode = Read | Write | Append | ReadWrite

base.io.Mode.Write

.> view base.io.Mode.Write

  type base.io.Mode = Read | Write | Append | ReadWrite

base.io.SeekMode

.> view base.io.SeekMode

  unique type base.io.SeekMode = Absolute | Relative | FromEnd

base.io.SeekMode.Absolute

.> view base.io.SeekMode.Absolute

  unique type base.io.SeekMode = Absolute | Relative | FromEnd

base.io.SeekMode.FromEnd

.> view base.io.SeekMode.FromEnd

  unique type base.io.SeekMode = Absolute | Relative | FromEnd

base.io.SeekMode.Relative

.> view base.io.SeekMode.Relative

  unique type base.io.SeekMode = Absolute | Relative | FromEnd

base.io.ServiceName

.> view base.io.ServiceName

  unique type base.io.ServiceName = ServiceName Text

base.io.ServiceName.ServiceName

.> view base.io.ServiceName.ServiceName

  unique type base.io.ServiceName = ServiceName Text

base.io.Socket

.> view base.io.Socket

  unique type base.io.Socket = Socket Text

base.io.Socket.Socket

.> view base.io.Socket.Socket

  unique type base.io.Socket = Socket Text

base.io.ThreadId

.> view base.io.ThreadId

  unique type base.io.ThreadId = ThreadId Text

base.io.ThreadId.ThreadId

.> view base.io.ThreadId.ThreadId

  unique type base.io.ThreadId = ThreadId Text

base.io.accept

.> view base.io.accept

  base.io.accept : Socket ->{IO} Socket
  base.io.accept s = rethrow (accept_ s)

base.io.bracket

.> view base.io.bracket

  base.io.bracket :
    '{IO} a -> (a ->{IO} b) -> (a ->{IO} c) ->{IO} c
  base.io.bracket acquire release what =
    rethrow (bracket_ acquire release what)

base.io.clientSocket

.> view base.io.clientSocket

  base.io.clientSocket : HostName -> ServiceName ->{IO} Socket
  base.io.clientSocket host service =
    rethrow (clientSocket_ host service)

base.io.closeFile

.> view base.io.closeFile

  base.io.closeFile : Handle ->{IO} ()
  base.io.closeFile f = rethrow (closeFile_ f)

base.io.closeSocket

.> view base.io.closeSocket

  base.io.closeSocket : Socket ->{IO} ()
  base.io.closeSocket s = rethrow (closeSocket_ s)

base.io.createDirectory

.> view base.io.createDirectory

  base.io.createDirectory : FilePath ->{IO} ()
  base.io.createDirectory d = rethrow (createDirectory_ d)

base.io.delay

.> view base.io.delay

  base.io.delay : Nat ->{IO} ()
  base.io.delay n = rethrow (delay_ n)

base.io.directoryContents

.> view base.io.directoryContents

  base.io.directoryContents : FilePath ->{IO} [FilePath]
  base.io.directoryContents d = rethrow (directoryContents_ d)

base.io.fileExists

.> view base.io.fileExists

  base.io.fileExists : FilePath ->{IO} Boolean
  base.io.fileExists d = rethrow (fileExists_ d)

base.io.fork

.> view base.io.fork

  base.io.fork : '{IO} a ->{IO} ThreadId
  base.io.fork a = rethrow (fork_ a)

base.io.getBuffering

.> view base.io.getBuffering

  base.io.getBuffering : Handle ->{IO} Optional BufferMode
  base.io.getBuffering h = rethrow (getBuffering_ h)

base.io.getCurrentDirectory

.> view base.io.getCurrentDirectory

  base.io.getCurrentDirectory : '{IO} FilePath
  base.io.getCurrentDirectory = '(rethrow getCurrentDirectory_)

base.io.getFileSize

.> view base.io.getFileSize

  base.io.getFileSize : FilePath ->{IO} Nat
  base.io.getFileSize d = rethrow (getFileSize_ d)

base.io.getFileTimestamp

.> view base.io.getFileTimestamp

  base.io.getFileTimestamp : FilePath ->{IO} EpochTime
  base.io.getFileTimestamp d = rethrow (getFileTimestamp_ d)

base.io.getLine

.> view base.io.getLine

  base.io.getLine : Handle ->{IO} Text
  base.io.getLine h = rethrow (getLine_ h)

base.io.getTemporaryDirectory

.> view base.io.getTemporaryDirectory

  base.io.getTemporaryDirectory : '{IO} FilePath
  base.io.getTemporaryDirectory =
    '(rethrow getTemporaryDirectory_)

base.io.getText

.> view base.io.getText

  base.io.getText : Handle ->{IO} Text
  base.io.getText h = rethrow (getText_ h)

base.io.isDirectory

.> view base.io.isDirectory

  base.io.isDirectory : FilePath ->{IO} Boolean
  base.io.isDirectory d = rethrow (isDirectory_ d)

base.io.isFileEOF

.> view base.io.isFileEOF

  base.io.isFileEOF : Handle ->{IO} Boolean
  base.io.isFileEOF h = rethrow (isFileEOF_ h)

base.io.isFileOpen

.> view base.io.isFileOpen

  base.io.isFileOpen : Handle ->{IO} Boolean
  base.io.isFileOpen h = rethrow (isFileOpen_ h)

base.io.isSeekable

.> view base.io.isSeekable

  base.io.isSeekable : Handle ->{IO} Boolean
  base.io.isSeekable h = rethrow (isSeekable_ h)

base.io.kill

.> view base.io.kill

  base.io.kill : ThreadId ->{IO} ()
  base.io.kill t = rethrow (kill_ t)

base.io.listen

.> view base.io.listen

  base.io.listen : Socket ->{IO} ()
  base.io.listen s = rethrow (listen_ s)

base.io.openFile

.> view base.io.openFile

  base.io.openFile : FilePath -> Mode ->{IO} Handle
  base.io.openFile f m = rethrow (openFile_ f m)

base.io.position

.> view base.io.position

  base.io.position : Handle ->{IO} Int
  base.io.position h = rethrow (position_ h)

base.io.printLine

.> view base.io.printLine

  base.io.printLine : Text ->{IO} ()
  base.io.printLine t =
    putText stdout t
    putText stdout "\n"

base.io.putText

.> view base.io.putText

  base.io.putText : Handle -> Text ->{IO} ()
  base.io.putText h t = rethrow (putText_ h t)

base.io.readLine

.> view base.io.readLine

  base.io.readLine : '{IO} Text
  base.io.readLine = '(getLine stdin)

base.io.receive

.> view base.io.receive

  base.io.receive : Socket -> Nat ->{IO} Optional Bytes
  base.io.receive s n = rethrow (receive_ s n)

base.io.removeDirectory

.> view base.io.removeDirectory

  base.io.removeDirectory : FilePath ->{IO} ()
  base.io.removeDirectory d = rethrow (removeDirectory_ d)

base.io.removeFile

.> view base.io.removeFile

  base.io.removeFile : FilePath ->{IO} ()
  base.io.removeFile d = rethrow (removeFile_ d)

base.io.renameDirectory

.> view base.io.renameDirectory

  base.io.renameDirectory : FilePath -> FilePath ->{IO} ()
  base.io.renameDirectory from to =
    rethrow (renameDirectory_ from to)

base.io.renameFile

.> view base.io.renameFile

  base.io.renameFile : FilePath -> FilePath ->{IO} ()
  base.io.renameFile from to = rethrow (renameFile_ from to)

base.io.rethrow

.> view base.io.rethrow

  base.io.rethrow : Either Error a ->{IO} a
  base.io.rethrow = cases
    Left e  -> throw e
    Right a -> a

base.io.seek

.> view base.io.seek

  base.io.seek : Handle -> SeekMode -> Int ->{IO} ()
  base.io.seek h m i = rethrow (seek_ h m i)

base.io.send

.> view base.io.send

  base.io.send : Socket -> Bytes ->{IO} ()
  base.io.send s bs = rethrow (send_ s bs)

base.io.serverSocket

.> view base.io.serverSocket

  base.io.serverSocket :
    Optional HostName -> ServiceName ->{IO} Socket
  base.io.serverSocket host service =
    rethrow (serverSocket_ host service)

base.io.setBuffering

.> view base.io.setBuffering

  base.io.setBuffering : Handle -> Optional BufferMode ->{IO} ()
  base.io.setBuffering h bm = rethrow (setBuffering_ h bm)

base.io.setCurrentDirectory

.> view base.io.setCurrentDirectory

  base.io.setCurrentDirectory : FilePath ->{IO} ()
  base.io.setCurrentDirectory d =
    rethrow (setCurrentDirectory_ d)

base.io.stderr

.> view base.io.stderr

  base.io.stderr : Handle
  base.io.stderr = Handle "stderr"

base.io.stdin

.> view base.io.stdin

  base.io.stdin : Handle
  base.io.stdin = Handle "stdin"

base.io.stdout

.> view base.io.stdout

  base.io.stdout : Handle
  base.io.stdout = Handle "stdout"

base.io.systemTime

.> view base.io.systemTime

  base.io.systemTime : '{IO} EpochTime
  base.io.systemTime = '(rethrow systemTime_)

base.metadata.authors.anovstrup

.> view base.metadata.authors.anovstrup

  base.metadata.authors.anovstrup : Author
  base.metadata.authors.anovstrup =
    Author anovstrup.guid "Aaron Novstrup"

base.metadata.authors.anovstrup.guid

.> view base.metadata.authors.anovstrup.guid

  base.metadata.authors.anovstrup.guid : GUID
  base.metadata.authors.anovstrup.guid =
    GUID
      (Bytes.fromList
        [ 217,
          172,
          26,
          5,
          195,
          156,
          65,
          102,
          105,
          181,
          73,
          28,
          125,
          139,
          212,
          59,
          84,
          11,
          210,
          253,
          100,
          6,
          104,
          116,
          109,
          136,
          215,
          47,
          252,
          166,
          82,
          173 ])

base.metadata.authors.aryairani

.> view base.metadata.authors.aryairani

  base.metadata.authors.aryairani : Author
  base.metadata.authors.aryairani =
    Author aryairani.guid "Arya Irani"

base.metadata.authors.aryairani.guid

.> view base.metadata.authors.aryairani.guid

  base.metadata.authors.aryairani.guid : GUID
  base.metadata.authors.aryairani.guid =
    GUID
      (Bytes.fromList
        [ 174,
          132,
          154,
          39,
          34,
          240,
          19,
          138,
          200,
          13,
          125,
          26,
          187,
          45,
          160,
          149,
          235,
          85,
          71,
          31,
          165,
          96,
          220,
          148,
          166,
          55,
          207,
          229,
          28,
          75,
          109,
          97 ])

base.metadata.authors.atacratic

.> view base.metadata.authors.atacratic

  base.metadata.authors.atacratic : Author
  base.metadata.authors.atacratic =
    Author atacratic.guid "Chris Gibbs"

base.metadata.authors.atacratic.guid

.> view base.metadata.authors.atacratic.guid

  base.metadata.authors.atacratic.guid : GUID
  base.metadata.authors.atacratic.guid =
    GUID
      (Bytes.fromList
        [ 205,
          203,
          40,
          64,
          61,
          20,
          240,
          112,
          107,
          162,
          56,
          167,
          205,
          86,
          181,
          115,
          65,
          217,
          76,
          29,
          227,
          121,
          205,
          13,
          150,
          73,
          239,
          78,
          140,
          42,
          169,
          203 ])

base.metadata.authors.ceedubs

.> view base.metadata.authors.ceedubs

  base.metadata.authors.ceedubs : Author
  base.metadata.authors.ceedubs =
    Author ceedubs.guid "Cody Allen"

base.metadata.authors.ceedubs.guid

.> view base.metadata.authors.ceedubs.guid

  base.metadata.authors.ceedubs.guid : GUID
  base.metadata.authors.ceedubs.guid =
    GUID
      (Bytes.fromList
        [ 3,
          52,
          134,
          251,
          110,
          206,
          29,
          114,
          160,
          59,
          248,
          5,
          23,
          235,
          138,
          161,
          149,
          1,
          235,
          228,
          248,
          146,
          60,
          215,
          76,
          40,
          88,
          155,
          217,
          104,
          149,
          142 ])

base.metadata.authors.dariooddenino

.> view base.metadata.authors.dariooddenino

  base.metadata.authors.dariooddenino : Author
  base.metadata.authors.dariooddenino =
    Author dariooddenino.guid "Dario Oddenino"

base.metadata.authors.dariooddenino.guid

.> view base.metadata.authors.dariooddenino.guid

  base.metadata.authors.dariooddenino.guid : GUID
  base.metadata.authors.dariooddenino.guid =
    GUID
      (Bytes.fromList
        [ 71,
          158,
          210,
          95,
          247,
          217,
          53,
          121,
          139,
          153,
          15,
          168,
          202,
          112,
          38,
          0,
          246,
          106,
          127,
          195,
          235,
          142,
          34,
          207,
          56,
          225,
          29,
          255,
          3,
          97,
          154,
          215 ])

base.metadata.authors.dolio

.> view base.metadata.authors.dolio

  base.metadata.authors.dolio : Author
  base.metadata.authors.dolio = Author dolio.guid "Dan Doel"

base.metadata.authors.dolio.guid

.> view base.metadata.authors.dolio.guid

  base.metadata.authors.dolio.guid : GUID
  base.metadata.authors.dolio.guid =
    GUID
      (Bytes.fromList
        [ 39,
          132,
          77,
          7,
          8,
          204,
          246,
          152,
          29,
          106,
          90,
          79,
          254,
          203,
          153,
          118,
          66,
          160,
          228,
          32,
          3,
          12,
          75,
          54,
          40,
          206,
          33,
          196,
          128,
          49,
          222,
          57 ])

base.metadata.authors.emiflake

.> view base.metadata.authors.emiflake

  base.metadata.authors.emiflake : Author
  base.metadata.authors.emiflake =
    Author emiflake.guid "Emily Martins"

base.metadata.authors.emiflake.guid

.> view base.metadata.authors.emiflake.guid

  base.metadata.authors.emiflake.guid : GUID
  base.metadata.authors.emiflake.guid =
    GUID
      (Bytes.fromList
        [ 234,
          155,
          229,
          53,
          239,
          175,
          24,
          44,
          138,
          185,
          41,
          26,
          103,
          255,
          148,
          245,
          234,
          91,
          93,
          44,
          24,
          58,
          154,
          242,
          42,
          97,
          142,
          191,
          126,
          69,
          118,
          148 ])

base.metadata.authors.pchiusano

.> view base.metadata.authors.pchiusano

  base.metadata.authors.pchiusano : Author
  base.metadata.authors.pchiusano =
    Author pchiusano.guid "Paul Chiusano"

base.metadata.authors.pchiusano.guid

.> view base.metadata.authors.pchiusano.guid

  base.metadata.authors.pchiusano.guid : GUID
  base.metadata.authors.pchiusano.guid =
    GUID
      (Bytes.fromList
        [ 186,
          184,
          251,
          143,
          145,
          211,
          168,
          146,
          198,
          232,
          25,
          114,
          197,
          247,
          151,
          102,
          40,
          15,
          90,
          44,
          118,
          254,
          65,
          202,
          224,
          64,
          29,
          163,
          238,
          36,
          131,
          6 ])

base.metadata.authors.pete_ts

.> view base.metadata.authors.pete_ts

  base.metadata.authors.pete_ts : Author
  base.metadata.authors.pete_ts =
    Author pete_ts.guid "Pete Tsamouris"

base.metadata.authors.pete_ts.guid

.> view base.metadata.authors.pete_ts.guid

  base.metadata.authors.pete_ts.guid : GUID
  base.metadata.authors.pete_ts.guid =
    GUID
      (Bytes.fromList
        [ 184,
          140,
          34,
          237,
          32,
          118,
          231,
          46,
          164,
          179,
          119,
          99,
          182,
          153,
          111,
          54,
          189,
          218,
          81,
          132,
          77,
          50,
          241,
          248,
          246,
          56,
          162,
          30,
          49,
          92,
          227,
          193 ])

base.metadata.authors.runarorama

.> view base.metadata.authors.runarorama

  base.metadata.authors.runarorama : Author
  base.metadata.authors.runarorama =
    Author runarorama.guid "RΓΊnar Bjarnason"

base.metadata.authors.runarorama.guid

.> view base.metadata.authors.runarorama.guid

  base.metadata.authors.runarorama.guid : GUID
  base.metadata.authors.runarorama.guid =
    GUID
      (Bytes.fromList
        [ 133,
          195,
          228,
          210,
          5,
          84,
          157,
          106,
          204,
          237,
          121,
          193,
          214,
          219,
          47,
          43,
          194,
          222,
          189,
          60,
          212,
          51,
          123,
          111,
          244,
          153,
          172,
          58,
          128,
          177,
          199,
          164 ])

base.metadata.authors.unisoncomputing.guid

.> view base.metadata.authors.unisoncomputing.guid

  base.metadata.authors.unisoncomputing.guid : GUID
  base.metadata.authors.unisoncomputing.guid =
    GUID
      (Bytes.fromList
        [ 225,
          126,
          119,
          218,
          155,
          122,
          127,
          231,
          8,
          17,
          87,
          226,
          33,
          92,
          188,
          227,
          135,
          161,
          108,
          116,
          152,
          180,
          61,
          16,
          246,
          208,
          77,
          23,
          191,
          73,
          178,
          82 ])

base.metadata.authors.zenhack

.> view base.metadata.authors.zenhack

  base.metadata.authors.zenhack : Author
  base.metadata.authors.zenhack =
    Author zenhack.guid "Ian DenHardt"

base.metadata.authors.zenhack.guid

.> view base.metadata.authors.zenhack.guid

  base.metadata.authors.zenhack.guid : GUID
  base.metadata.authors.zenhack.guid =
    GUID
      (Bytes.fromList
        [ 87,
          254,
          69,
          125,
          90,
          91,
          238,
          82,
          236,
          133,
          4,
          223,
          161,
          146,
          156,
          107,
          153,
          132,
          226,
          202,
          18,
          145,
          220,
          135,
          180,
          188,
          194,
          156,
          142,
          119,
          209,
          4 ])

base.metadata.copyrightHolders.anovstrup

.> view base.metadata.copyrightHolders.anovstrup

  base.metadata.copyrightHolders.anovstrup : CopyrightHolder
  base.metadata.copyrightHolders.anovstrup =
    CopyrightHolder anovstrup.guid "Aaron Novstrup"

base.metadata.copyrightHolders.atacratic

.> view base.metadata.copyrightHolders.atacratic

  base.metadata.copyrightHolders.atacratic : CopyrightHolder
  base.metadata.copyrightHolders.atacratic =
    CopyrightHolder atacratic.guid "Chris Gibbs"

base.metadata.copyrightHolders.ceedubs

.> view base.metadata.copyrightHolders.ceedubs

  base.metadata.copyrightHolders.ceedubs : CopyrightHolder
  base.metadata.copyrightHolders.ceedubs =
    CopyrightHolder ceedubs.guid "Cody Allen"

base.metadata.copyrightHolders.dariooddenino

.> view base.metadata.copyrightHolders.dariooddenino

  base.metadata.copyrightHolders.dariooddenino : CopyrightHolder
  base.metadata.copyrightHolders.dariooddenino =
    CopyrightHolder dariooddenino.guid "Dario Oddenino"

base.metadata.copyrightHolders.emiflake

.> view base.metadata.copyrightHolders.emiflake

  base.metadata.copyrightHolders.emiflake : CopyrightHolder
  base.metadata.copyrightHolders.emiflake =
    CopyrightHolder emiflake.guid "Emily Martins"

base.metadata.copyrightHolders.pete_ts

.> view base.metadata.copyrightHolders.pete_ts

  base.metadata.copyrightHolders.pete_ts : CopyrightHolder
  base.metadata.copyrightHolders.pete_ts =
    CopyrightHolder pete_ts.guid "Pete Tsamouris"

base.metadata.copyrightHolders.unisoncomputing

.> view base.metadata.copyrightHolders.unisoncomputing

  base.metadata.copyrightHolders.unisoncomputing :
    CopyrightHolder
  base.metadata.copyrightHolders.unisoncomputing =
    CopyrightHolder
      unisoncomputing.guid
      "Unison Computing, public benefit corp"

base.metadata.copyrightHolders.zenhack

.> view base.metadata.copyrightHolders.zenhack

  base.metadata.copyrightHolders.zenhack : CopyrightHolder
  base.metadata.copyrightHolders.zenhack =
    CopyrightHolder zenhack.guid "Ian DenHardt"

base.metadata.isPropagated

.> view base.metadata.isPropagated

  base.metadata.isPropagated : IsPropagated
  base.metadata.isPropagated = IsPropagated

base.metadata.isTest

.> view base.metadata.isTest

  base.metadata.isTest : IsTest
  base.metadata.isTest = IsTest

base.metadata.licenseTypes.bsd2

.> view base.metadata.licenseTypes.bsd2

  base.metadata.licenseTypes.bsd2 : LicenseType
  base.metadata.licenseTypes.bsd2 =
    LicenseType
      [: 
      Redistribution and use in source and binary forms, with or
      without modification, are permitted provided that the following
      conditions are met:
      
      1. Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
      
      2. Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following
      disclaimer in the documentation and/or other materials provided
      with the distribution.
      
      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
      "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
      NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
      FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
      SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
      DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
      DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
      GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
      INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
      OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
      EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      :]

base.metadata.licenseTypes.bsd3

.> view base.metadata.licenseTypes.bsd3

  base.metadata.licenseTypes.bsd3 : LicenseType
  base.metadata.licenseTypes.bsd3 =
    LicenseType
      [: 
      Redistribution and use in source and binary forms, with or
      without modification, are permitted provided that the following
      conditions are met:
      
      1. Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
      
      2. Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following
      disclaimer in the documentation and/or other materials provided
      with the distribution.
      
      3. Neither the name of the copyright holder nor the names of
      its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.
      
      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
      "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
      NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
      FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
      SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
      DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
      DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
      GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
      INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
      OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
      EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      :]

base.metadata.licenseTypes.mit

.> view base.metadata.licenseTypes.mit

  base.metadata.licenseTypes.mit : LicenseType
  base.metadata.licenseTypes.mit =
    LicenseType
      [: 
      Permission is hereby granted, free of charge, to any person
      obtaining a copy of this software and associated documentation
      files (the "Software"), to deal in the Software without restriction,
      including without limitation the rights to use, copy, modify,
      merge, publish, distribute, sublicense, and/or sell copies
      of the Software, and to permit persons to whom the Software
      is furnished to do so, subject to the following conditions:
      
      The above copyright notice and this permission notice shall
      be included in all copies or substantial portions of the Software.
      
      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
      EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
      OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
      IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
      FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
      OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
      CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
      THE SOFTWARE.
      :]

base.metadata.licenses.anovstrup.bsd2_2020

.> view base.metadata.licenses.anovstrup.bsd2_2020

  base.metadata.licenses.anovstrup.bsd2_2020 : License
  base.metadata.licenses.anovstrup.bsd2_2020 =
    License [copyrightHolders.anovstrup] [Year 2020] bsd2

base.metadata.licenses.anovstrup.bsd3_2020

.> view base.metadata.licenses.anovstrup.bsd3_2020

  base.metadata.licenses.anovstrup.bsd3_2020 : License
  base.metadata.licenses.anovstrup.bsd3_2020 =
    License [copyrightHolders.anovstrup] [Year 2020] bsd3

base.metadata.licenses.anovstrup.mit_2020

.> view base.metadata.licenses.anovstrup.mit_2020

  base.metadata.licenses.anovstrup.mit_2020 : License
  base.metadata.licenses.anovstrup.mit_2020 =
    License [copyrightHolders.anovstrup] [Year 2020] mit

base.metadata.licenses.atacratic.mit_2020

.> view base.metadata.licenses.atacratic.mit_2020

  base.metadata.licenses.atacratic.mit_2020 : License
  base.metadata.licenses.atacratic.mit_2020 =
    License [copyrightHolders.atacratic] [Year 2020] mit

base.metadata.licenses.ceedubs2020

.> view base.metadata.licenses.ceedubs2020

  base.metadata.licenses.ceedubs2020 : License
  base.metadata.licenses.ceedubs2020 =
    License [copyrightHolders.ceedubs] [Year 2020] mit

base.metadata.licenses.dariooddenino.dariooddenino2020

.> view base.metadata.licenses.dariooddenino.dariooddenino2020

  base.metadata.licenses.dariooddenino.dariooddenino2020 :
    License
  base.metadata.licenses.dariooddenino.dariooddenino2020 =
    License [copyrightHolders.dariooddenino] [Year 2020] mit

base.metadata.licenses.emiflake_mit_2020

.> view base.metadata.licenses.emiflake_mit_2020

  base.metadata.licenses.emiflake_mit_2020 : License
  base.metadata.licenses.emiflake_mit_2020 =
    License [copyrightHolders.emiflake] [Year 2020] mit

base.metadata.licenses.pete_ts.bsd2_2020

.> view base.metadata.licenses.pete_ts.bsd2_2020

  base.metadata.licenses.pete_ts.bsd2_2020 : License
  base.metadata.licenses.pete_ts.bsd2_2020 =
    License [copyrightHolders.pete_ts] [Year 2020] bsd2

base.metadata.licenses.pete_ts.bsd3_2020

.> view base.metadata.licenses.pete_ts.bsd3_2020

  base.metadata.licenses.pete_ts.bsd3_2020 : License
  base.metadata.licenses.pete_ts.bsd3_2020 =
    License [copyrightHolders.pete_ts] [Year 2020] bsd3

base.metadata.licenses.pete_ts.mit_2020

.> view base.metadata.licenses.pete_ts.mit_2020

  base.metadata.licenses.pete_ts.mit_2020 : License
  base.metadata.licenses.pete_ts.mit_2020 =
    License [copyrightHolders.pete_ts] [Year 2020] mit

base.metadata.licenses.unisoncomputing2020

.> view base.metadata.licenses.unisoncomputing2020

  base.metadata.licenses.unisoncomputing2020 : License
  base.metadata.licenses.unisoncomputing2020 =
    License [unisoncomputing] [Year 2020] mit

base.metadata.licenses.zenhack2020

.> view base.metadata.licenses.zenhack2020

  base.metadata.licenses.zenhack2020 : License
  base.metadata.licenses.zenhack2020 =
    License [copyrightHolders.zenhack] [Year 2020] mit

base.metadata.unassignedGuids.guid3

.> view base.metadata.unassignedGuids.guid3

  base.metadata.unassignedGuids.guid3 : GUID
  base.metadata.unassignedGuids.guid3 =
    GUID
      (Bytes.fromList
        [ 112,
          180,
          4,
          187,
          39,
          141,
          151,
          95,
          42,
          254,
          159,
          33,
          20,
          67,
          211,
          25,
          226,
          40,
          113,
          216,
          68,
          251,
          202,
          0,
          245,
          147,
          110,
          220,
          155,
          192,
          197,
          165 ])

base.metadata.unassignedGuids.guid4

.> view base.metadata.unassignedGuids.guid4

  base.metadata.unassignedGuids.guid4 : GUID
  base.metadata.unassignedGuids.guid4 =
    GUID
      (Bytes.fromList
        [ 107,
          138,
          234,
          31,
          221,
          93,
          190,
          98,
          137,
          75,
          200,
          134,
          244,
          145,
          209,
          146,
          229,
          10,
          176,
          124,
          199,
          80,
          169,
          2,
          13,
          55,
          24,
          230,
          236,
          171,
          150,
          72 ])

base.metadata.unassignedGuids.guid5

.> view base.metadata.unassignedGuids.guid5

  base.metadata.unassignedGuids.guid5 : GUID
  base.metadata.unassignedGuids.guid5 =
    GUID
      (Bytes.fromList
        [ 194,
          7,
          120,
          232,
          114,
          168,
          57,
          121,
          43,
          44,
          3,
          78,
          174,
          62,
          12,
          213,
          15,
          219,
          122,
          158,
          58,
          223,
          170,
          249,
          23,
          37,
          205,
          63,
          117,
          201,
          76,
          233 ])

base.metadata.unassignedGuids.guid6

.> view base.metadata.unassignedGuids.guid6

  base.metadata.unassignedGuids.guid6 : GUID
  base.metadata.unassignedGuids.guid6 =
    GUID
      (Bytes.fromList
        [ 188,
          88,
          126,
          64,
          19,
          204,
          9,
          91,
          178,
          196,
          149,
          154,
          235,
          127,
          79,
          96,
          86,
          97,
          167,
          85,
          27,
          163,
          8,
          38,
          144,
          207,
          133,
          35,
          89,
          177,
          115,
          128 ])

base.metadata.unassignedGuids.guid8

.> view base.metadata.unassignedGuids.guid8

  base.metadata.unassignedGuids.guid8 : GUID
  base.metadata.unassignedGuids.guid8 =
    GUID
      (Bytes.fromList
        [ 186,
          74,
          70,
          142,
          243,
          29,
          66,
          61,
          225,
          108,
          143,
          152,
          157,
          1,
          51,
          191,
          103,
          129,
          131,
          14,
          224,
          18,
          45,
          22,
          250,
          21,
          148,
          198,
          242,
          175,
          160,
          138 ])

base.prs.pr1.note1

.> view base.prs.pr1.note1

  base.prs.pr1.note1 : Doc
  base.prs.pr1.note1 =
    [: 
    This PR syncs base to incorporate all the latest additions to
    `.builtin`, including support for assigning authorship and licensing
    information to definitions:
    
    ```
    @[source] Author
    
    @[source] License
    ```
    
    There are various `@LicenseType` values in the `licenseTypes`
    namespace, for instance:
    
    ```
    @[source] mit
    ```
    
    Most of the code in base is MIT-licensed, see `@unisoncomputing2020`.
    
    Also see the `metadata.authors` namespace which has the contributors
    to this codebase (for instance, `@aryairani`).
    
    :]

base.repeat

.> view base.repeat

  base.repeat : Nat -> '{e} a ->{e} ()
  base.repeat n op =
    if n == 0 then ()
    else
      !op
      base.repeat (Nat.drop n 1) op

base.test.===

.> view base.test.===

  (base.test.===) : a -> a -> Boolean
  actual base.test.=== expected =
    assert
      (actual == expected)
      ("The values being compared are not equal",
      actual,
      expected)
      true

base.test.Gen

.> view base.test.Gen

  ability base.test.Gen where
    Gen.sample : Weighted a ->{base.test.Gen} a

base.test.Gen.append

.> view base.test.Gen.append

  base.test.Gen.append : '{Gen} a -> '{Gen} a -> '{Gen} a
  base.test.Gen.append g1 g2 =
    w1 = toWeighted g1
    w2 = toWeighted g2
    w3 = Weighted.append w1 w2
    '(Gen.sample w3)

base.test.Gen.append.examples.ex1

.> view base.test.Gen.append.examples.ex1

  base.test.Gen.append.examples.ex1 : [Nat]
  base.test.Gen.append.examples.ex1 =
    test.sample 10 <| Gen.append (natIn 0 3) (natIn 3 5)

base.test.Gen.append.examples.ex2

.> view base.test.Gen.append.examples.ex2

  base.test.Gen.append.examples.ex2 : [Nat]
  base.test.Gen.append.examples.ex2 =
    test.sample 3 <| Gen.append (natIn 0 4) (natIn 100 130)

base.test.Gen.sample

.> view base.test.Gen.sample

  ability base.test.Gen where
    Gen.sample : Weighted a ->{base.test.Gen} a

base.test.Gen.toWeighted

.> view base.test.Gen.toWeighted

  base.test.Gen.toWeighted : '{e, Gen} a ->{e} Weighted a
  base.test.Gen.toWeighted g =
    go = cases
      { a }               -> yield a
      {Gen.sample w -> k} ->
        Weighted.flatMap (a -> (handle k a with go)) w
    handle !g with go

base.test.Test

.> view base.test.Test

  type base.test.Test = Test (Scope -> Report)

base.test.assert

.> view base.test.assert

  base.test.assert : Boolean -> e -> a -> a
  base.test.assert b e a = if b then a else bug e

base.test.assertEquals

.> view base.test.assertEquals

  (base.test.===) : a -> a -> Boolean
  actual base.test.=== expected =
    assert
      (actual == expected)
      ("The values being compared are not equal",
      actual,
      expected)
      true

base.test.both

.> view base.test.both

  base.test.both : Test -> Test -> Test
  base.test.both a b =
    match (a, b) with
      (Test k1, Test k2) ->
        Test
          (scope ->
            r1 = k1 scope
            r2 = k2 scope
            Report.combine r1 r2)

base.test.cost

.> view base.test.cost

  base.test.cost : Nat -> '{Gen} a -> '{Gen} a
  base.test.cost n g _ = weight n '(toWeighted g) |> Gen.sample

base.test.expect

.> view base.test.expect

  base.test.expect : Boolean -> Test
  base.test.expect b = if b then passed else fail

base.test.fail

.> view base.test.fail

  base.test.fail : Test
  base.test.fail = finished Failed

base.test.failWith

.> view base.test.failWith

  base.test.failWith : Text -> Test
  base.test.failWith m = label m fail

base.test.gen.Char.alpha

.> view base.test.gen.Char.alpha

  base.test.gen.Char.alpha : '{Gen} Char
  base.test.gen.Char.alpha = Gen.append Char.lower Char.upper

base.test.gen.Char.alpha.sampled

.> view base.test.gen.Char.alpha.sampled

  base.test.gen.Char.alpha.sampled : [Char]
  base.test.gen.Char.alpha.sampled = test.sample 52 '(!alpha)

base.test.gen.Char.ascii

.> view base.test.gen.Char.ascii

  base.test.gen.Char.ascii : '{Gen} Char
  base.test.gen.Char.ascii =
    pick [Char.asciiPrintable, cost 5 asciiNonPrintable]

base.test.gen.Char.ascii.sampled

.> view base.test.gen.Char.ascii.sampled

  base.test.gen.Char.ascii.sampled : [Char]
  base.test.gen.Char.ascii.sampled =
    test.sample 20 '(!Char.ascii)

base.test.gen.Char.asciiNonPrintable

.> view base.test.gen.Char.asciiNonPrintable

  base.test.gen.Char.asciiNonPrintable : '{Gen} Char
  base.test.gen.Char.asciiNonPrintable =
    '(fromNat !(natIn 0 32))

base.test.gen.Char.asciiNonPrintable.sampled

.> view base.test.gen.Char.asciiNonPrintable.sampled

  base.test.gen.Char.asciiNonPrintable.sampled : [Char]
  base.test.gen.Char.asciiNonPrintable.sampled =
    test.sample 32 '(!asciiNonPrintable)

base.test.gen.Char.asciiPrintable

.> view base.test.gen.Char.asciiPrintable

  base.test.gen.Char.asciiPrintable : '{Gen} Char
  base.test.gen.Char.asciiPrintable = '(fromNat !(natIn 32 127))

base.test.gen.Char.asciiPrintable.sampled

.> view base.test.gen.Char.asciiPrintable.sampled

  base.test.gen.Char.asciiPrintable.sampled : [Char]
  base.test.gen.Char.asciiPrintable.sampled =
    test.sample (Nat.drop 127 32) '(!Char.asciiPrintable)

base.test.gen.Char.digit

.> view base.test.gen.Char.digit

  base.test.gen.Char.digit : '{Gen} Char
  base.test.gen.Char.digit = '(fromNat !(natIn 48 58))

base.test.gen.Char.digit.sampled

.> view base.test.gen.Char.digit.sampled

  base.test.gen.Char.digit.sampled : [Char]
  base.test.gen.Char.digit.sampled =
    test.sample (Nat.drop 58 48) '(!digit)

base.test.gen.Char.hexDigit

.> view base.test.gen.Char.hexDigit

  base.test.gen.Char.hexDigit : '{Gen} Char
  base.test.gen.Char.hexDigit =
    aTof : '{Gen} Char
    aTof = '(fromNat !(natIn 97 103))
    pick [cost 10 aTof, digit]

base.test.gen.Char.hexDigit.sampled

.> view base.test.gen.Char.hexDigit.sampled

  base.test.gen.Char.hexDigit.sampled : [Char]
  base.test.gen.Char.hexDigit.sampled =
    test.sample (Nat.drop 113 97) '(!hexDigit)

base.test.gen.Char.lower

.> view base.test.gen.Char.lower

  base.test.gen.Char.lower : '{Gen} Char
  base.test.gen.Char.lower = '(fromNat !(natIn 97 123))

base.test.gen.Char.lower.sampled

.> view base.test.gen.Char.lower.sampled

  base.test.gen.Char.lower.sampled : [Char]
  base.test.gen.Char.lower.sampled =
    test.sample (Nat.drop 123 97) '(!Char.lower)

base.test.gen.Char.upper

.> view base.test.gen.Char.upper

  base.test.gen.Char.upper : '{Gen} Char
  base.test.gen.Char.upper = '(fromNat !(natIn 65 91))

base.test.gen.Char.upper.sampled

.> view base.test.gen.Char.upper.sampled

  base.test.gen.Char.upper.sampled : [Char]
  base.test.gen.Char.upper.sampled =
    test.sample (Nat.drop 91 65) '(!Char.upper)

base.test.gen.Text.ascii

.> view base.test.gen.Text.ascii

  base.test.gen.Text.ascii : '{Gen} Text
  base.test.gen.Text.ascii =
    '(fromCharList !(listOf Char.ascii))

base.test.gen.Text.asciiPrintable

.> view base.test.gen.Text.asciiPrintable

  base.test.gen.Text.asciiPrintable : '{Gen} Text
  base.test.gen.Text.asciiPrintable =
    '(fromCharList !(listOf Char.asciiPrintable))

base.test.gen.atLeastOne

.> view base.test.gen.atLeastOne

  base.test.gen.atLeastOne : '{Gen} a -> '{Gen} Nonempty a
  base.test.gen.atLeastOne g =
    'let
      a = !g
      as = !(listOf g)
      Nonempty a as

base.test.gen.boolean

.> view base.test.gen.boolean

  base.test.gen.boolean : '{Gen} Boolean
  base.test.gen.boolean =
    '(Gen.sample (Weighted.fromList [false, true]))

base.test.gen.either

.> view base.test.gen.either

  base.test.gen.either : '{Gen} a -> '{Gen} b -> '{Gen} Either a b
  base.test.gen.either a b = pick ['(Left !a), '(Right !b)]

base.test.gen.either.test

.> view base.test.gen.either.test

  base.test.gen.either.test : [Result]
  base.test.gen.either.test =
    use Set fromList
    g = either gen.boolean (oneOf [0, 1])
    actual = fromList (test.sample 10 g)
    expected =
      fromList [Left false, Right 0, Left true, Right 1]
    check (expected == actual)

base.test.gen.empty

.> view base.test.gen.empty

  base.test.gen.empty : '{Gen} a
  base.test.gen.empty = '(Gen.sample Weighted.Fail)

base.test.gen.int

.> view base.test.gen.int

  base.test.gen.int : '{Gen} Int
  base.test.gen.int = '(Gen.sample Weighted.ints)

base.test.gen.listOf

.> view base.test.gen.listOf

  base.test.gen.listOf : '{Gen} a -> '{Gen} [a]
  base.test.gen.listOf g =
    'let
      size = !nat
      List.map (_ -> !g) (List.range 0 size)

base.test.gen.mapOf

.> view base.test.gen.mapOf

  base.test.gen.mapOf : '{Gen} k -> '{Gen} v -> '{Gen} Map k v
  base.test.gen.mapOf k v =
    '(Map.fromList !(listOf (pairOf k v)))

base.test.gen.nat

.> view base.test.gen.nat

  base.test.gen.nat : '{Gen} Nat
  base.test.gen.nat = '(Gen.sample Weighted.nats)

base.test.gen.natIn

.> view base.test.gen.natIn

  base.test.gen.natIn : Nat -> Nat -> '{Gen} Nat
  base.test.gen.natIn start stopExclusive _ =
    go n =
      if n < stopExclusive then
        use Nat +
        yield n <|> weight 1 '(go (n + 1))
      else Weighted.Fail
    Gen.sample (go start)

base.test.gen.oneOf

.> view base.test.gen.oneOf

  base.test.gen.oneOf : [a] -> '{Gen} a
  base.test.gen.oneOf as = '(Gen.sample (Weighted.fromList as))

base.test.gen.optional

.> view base.test.gen.optional

  base.test.gen.optional : '{Gen} a -> '{Gen} Optional a
  base.test.gen.optional a =
    Gen.append '(Gen.sample (yield None)) '(Some !a)

base.test.gen.optional.test

.> view base.test.gen.optional.test

  base.test.gen.optional.test : [Result]
  base.test.gen.optional.test =
    use Set fromList
    actual = fromList (test.sample 10 (optional gen.boolean))
    expected = fromList [None, Some false, Some true]
    check (expected == actual)

base.test.gen.pairOf

.> view base.test.gen.pairOf

  base.test.gen.pairOf : '{Gen} a -> '{Gen} b -> '{Gen} (a, b)
  base.test.gen.pairOf a b = '(!a, !b)

base.test.internals.v1.Domain

.> view base.test.internals.v1.Domain

  type base.test.internals.v1.Domain a
    = Small [a]
    | Large (Weighted a)

base.test.internals.v1.Domain.Large

.> view base.test.internals.v1.Domain.Large

  type base.test.internals.v1.Domain a
    = Small [a]
    | Large (Weighted a)

base.test.internals.v1.Domain.Small

.> view base.test.internals.v1.Domain.Small

  type base.test.internals.v1.Domain a
    = Small [a]
    | Large (Weighted a)

base.test.internals.v1.Domain.boolean

.> view base.test.internals.v1.Domain.boolean

  base.test.internals.v1.Domain.boolean : Domain Boolean
  base.test.internals.v1.Domain.boolean = Small [false, true]

base.test.internals.v1.Domain.ints

.> view base.test.internals.v1.Domain.ints

  base.test.internals.v1.Domain.ints : Domain Int
  base.test.internals.v1.Domain.ints =
    go n =
          yield n
      <|> weight
            1
            '(go
              (if n > +0 then negate n
              else Int.increment (negate n)))
    Large
      (    List.foldl
            (a n -> a <|> yield n)
            Weighted.Fail
            [+0, +1, -1, maxInt, minInt]
      <|> go +2)

base.test.internals.v1.Domain.lift2

.> view base.test.internals.v1.Domain.lift2

  base.test.internals.v1.Domain.lift2 :
    (a ->{𝕖} b ->{𝕖} c) -> Domain a -> Domain b ->{𝕖} Domain c
  base.test.internals.v1.Domain.lift2 f da db =
    use List size
    use Nat +
    wa = weighted da
    wb = weighted db
    wc = mergeWith (a1 a2 -> f a1 a2) wa wb
    match (da, db) with
      (Small as, Small bs) | size as + size bs < smallSize ->
        Small (Weighted.sample smallSize wc)
      _                                                    ->
        Large wc

base.test.internals.v1.Domain.lists

.> view base.test.internals.v1.Domain.lists

  base.test.internals.v1.Domain.lists : Domain [()]
  base.test.internals.v1.Domain.lists = listsOf (Small [()])

base.test.internals.v1.Domain.listsOf

.> view base.test.internals.v1.Domain.listsOf

  base.test.internals.v1.Domain.listsOf : Domain a -> Domain [a]
  base.test.internals.v1.Domain.listsOf d =
    Large
      (Weighted.lists
        (match d with
          Small as -> Weighted.fromList as
          Large w  -> w))

base.test.internals.v1.Domain.map

.> view base.test.internals.v1.Domain.map

  base.test.internals.v1.Domain.map :
    (a ->{𝕖} b) -> Domain a ->{𝕖} Domain b
  base.test.internals.v1.Domain.map f = cases
    Large w  -> Large (Weighted.map f w)
    Small as -> Small (List.map f as)

base.test.internals.v1.Domain.nats

.> view base.test.internals.v1.Domain.nats

  base.test.internals.v1.Domain.nats : Domain Nat
  base.test.internals.v1.Domain.nats = Large Weighted.nats

base.test.internals.v1.Domain.pairs

.> view base.test.internals.v1.Domain.pairs

  base.test.internals.v1.Domain.pairs :
    Domain a -> Domain (a, a)
  base.test.internals.v1.Domain.pairs d =
    lift2 (a b -> (a, b)) d d

base.test.internals.v1.Domain.sample

.> view base.test.internals.v1.Domain.sample

  base.test.internals.v1.Domain.sample : Nat -> Domain a -> [a]
  base.test.internals.v1.Domain.sample n = cases
    Large w  -> Weighted.sample n w
    Small xs -> List.take n xs

base.test.internals.v1.Domain.smallSize

.> view base.test.internals.v1.Domain.smallSize

  base.test.internals.v1.Domain.smallSize : Nat
  base.test.internals.v1.Domain.smallSize = 10000

base.test.internals.v1.Domain.tuples

.> view base.test.internals.v1.Domain.tuples

  base.test.internals.v1.Domain.tuples :
    Domain a -> Domain b -> Domain (Tuple a b)
  base.test.internals.v1.Domain.tuples = lift2 (a b -> Cons a b)

base.test.internals.v1.Domain.weighted

.> view base.test.internals.v1.Domain.weighted

  base.test.internals.v1.Domain.weighted : Domain a -> Weighted a
  base.test.internals.v1.Domain.weighted = cases
    Small as -> Weighted.fromList as
    Large w  -> w

base.test.internals.v1.Scope.cons

.> view base.test.internals.v1.Scope.cons

  base.test.internals.v1.Scope.cons : Text -> Scope -> Scope
  base.test.internals.v1.Scope.cons n =
    foldScope ( Scope ((+:) n))

base.test.internals.v1.Status.combine

.> view base.test.internals.v1.Status.combine

  base.test.internals.v1.Status.combine :
    Status -> Status -> Status
  base.test.internals.v1.Status.combine s1 s2 =
    use Success combine
    match (s1, s2) with
      (_, Pending)                 -> Pending
      (Pending, _)                 -> Pending
      (Failed, _)                  -> Failed
      (_, Failed)                  -> Failed
      (Unexpected a, Unexpected b) -> Unexpected (combine a b)
      (Unexpected a, _)            -> Unexpected a
      (_, Unexpected b)            -> Unexpected b
      (Expected a, Expected b)     -> Expected (combine a b)

base.test.internals.v1.Status.pending

.> view base.test.internals.v1.Status.pending

  base.test.internals.v1.Status.pending : Status -> Status
  base.test.internals.v1.Status.pending = cases
    Failed       -> Pending
    Expected s   -> Unexpected s
    Unexpected s -> Pending
    Pending      -> Pending

base.test.internals.v1.Success.combine

.> view base.test.internals.v1.Success.combine

  base.test.internals.v1.Success.combine :
    Success -> Success -> Success
  base.test.internals.v1.Success.combine s1 s2 =
    match (s1, s2) with
      (Passed n, Passed m) ->
        use Nat +
        Passed (n + m)
      (Passed n, Proved)   -> Passed n
      (Proved, Passed n)   -> Passed n
      (Proved, Proved)     -> Proved

base.test.internals.v1.Test.Report

.> view base.test.internals.v1.Test.Report

  type base.test.internals.v1.Test.Report
    = Report (Trie Text Status)

base.test.internals.v1.Test.Report.Report

.> view base.test.internals.v1.Test.Report.Report

  type base.test.internals.v1.Test.Report
    = Report (Trie Text Status)

base.test.internals.v1.Test.Report.combine

.> view base.test.internals.v1.Test.Report.combine

  base.test.internals.v1.Test.Report.combine :
    Report -> Report -> Report
  base.test.internals.v1.Test.Report.combine r1 r2 =
    match (r1, r2) with
      (Report t1, Report t2) ->
        Report <| Trie.unionWith Status.combine t1 t2

base.test.internals.v1.Test.Report.empty

.> view base.test.internals.v1.Test.Report.empty

  base.test.internals.v1.Test.Report.empty : Report
  base.test.internals.v1.Test.Report.empty = Report Trie.empty

base.test.internals.v1.Test.Report.toCLIResult

.> view base.test.internals.v1.Test.Report.toCLIResult

  base.test.internals.v1.Test.Report.toCLIResult :
    Report -> [Result]
  base.test.internals.v1.Test.Report.toCLIResult r =
    use Text ++
    descend scope = cases
      (k, t) ->
        use Text !=
        go ((if scope != "" then scope ++ "." else "") ++ k) t
    convert : Text -> Status -> Result
    convert scope = cases
      Failed              -> Result.Fail scope
      Expected (Passed n) ->
        Ok (scope ++ " : Passed " ++ Nat.toText n ++ " tests.")
      Expected Proved     -> Ok (scope ++ " : Proved.")
    go : Text -> Trie Text Status -> [Result]
    go scope t =
      rest = List.flatMap (descend scope) (Map.toList (Trie.tail t))
      match Trie.head t with
        Some status -> convert scope status +: rest
        None        -> rest
    match r with Report t -> go "" t

base.test.internals.v1.Test.Scope

.> view base.test.internals.v1.Test.Scope

  unique type base.test.internals.v1.Test.Scope = Scope [Text]

base.test.internals.v1.Test.Scope.Scope

.> view base.test.internals.v1.Test.Scope.Scope

  unique type base.test.internals.v1.Test.Scope = Scope [Text]

base.test.internals.v1.Test.Status

.> view base.test.internals.v1.Test.Status

  type base.test.internals.v1.Test.Status
    = Failed
    | Pending
    | Expected Success
    | Unexpected Success

base.test.internals.v1.Test.Status.Expected

.> view base.test.internals.v1.Test.Status.Expected

  type base.test.internals.v1.Test.Status
    = Failed
    | Pending
    | Expected Success
    | Unexpected Success

base.test.internals.v1.Test.Status.Failed

.> view base.test.internals.v1.Test.Status.Failed

  type base.test.internals.v1.Test.Status
    = Failed
    | Pending
    | Expected Success
    | Unexpected Success

base.test.internals.v1.Test.Status.Pending

.> view base.test.internals.v1.Test.Status.Pending

  type base.test.internals.v1.Test.Status
    = Failed
    | Pending
    | Expected Success
    | Unexpected Success

base.test.internals.v1.Test.Status.Unexpected

.> view base.test.internals.v1.Test.Status.Unexpected

  type base.test.internals.v1.Test.Status
    = Failed
    | Pending
    | Expected Success
    | Unexpected Success

base.test.internals.v1.Test.Success

.> view base.test.internals.v1.Test.Success

  type base.test.internals.v1.Test.Success = Proved | Passed Nat

base.test.internals.v1.Test.Success.Passed

.> view base.test.internals.v1.Test.Success.Passed

  type base.test.internals.v1.Test.Success = Proved | Passed Nat

base.test.internals.v1.Test.Success.Proved

.> view base.test.internals.v1.Test.Success.Proved

  type base.test.internals.v1.Test.Success = Proved | Passed Nat

base.test.internals.v1.Test.Test

.> view base.test.internals.v1.Test.Test

  type base.test.Test = Test (Scope -> Report)

base.test.internals.v1.Test.Test.Test

.> view base.test.internals.v1.Test.Test.Test

  type base.test.Test = Test (Scope -> Report)

base.test.internals.v1.Test.check

.> view base.test.internals.v1.Test.check

  base.test.internals.v1.Test.check : Boolean -> [Result]
  base.test.internals.v1.Test.check =  run check'

base.test.internals.v1.Test.check'

.> view base.test.internals.v1.Test.check'

  base.test.internals.v1.Test.check' : Boolean -> Test
  base.test.internals.v1.Test.check' b =
    if b then prove else fail

base.test.internals.v1.Test.failed

.> view base.test.internals.v1.Test.failed

  base.test.fail : Test
  base.test.fail = finished Failed

base.test.internals.v1.Test.failedWith

.> view base.test.internals.v1.Test.failedWith

  base.test.failWith : Text -> Test
  base.test.failWith m = label m fail

base.test.internals.v1.Test.finished

.> view base.test.internals.v1.Test.finished

  base.test.internals.v1.Test.finished : Status -> Test
  base.test.internals.v1.Test.finished st =
    Test ( Report (foldScope (sc -> Trie.singleton sc st)))

base.test.internals.v1.Test.forAll

.> view base.test.internals.v1.Test.forAll

  base.test.internals.v1.Test.forAll :
    Nat -> Domain a -> (a ->{𝕖} Boolean) ->{𝕖} [Result]
  base.test.internals.v1.Test.forAll n d p = run (forAll' n d p)

base.test.internals.v1.Test.forAll'

.> view base.test.internals.v1.Test.forAll'

  base.test.internals.v1.Test.forAll' :
    Nat -> Domain a -> (a ->{𝕖} Boolean) ->{𝕖} Test
  base.test.internals.v1.Test.forAll' maxSize domain property =
    check xs s =
      List.map
        (cases
          (c, i) ->
            if property c then finished (Expected s)
            else
              use Text ++
              label
                ("test case " ++ Nat.toText i) (finished Failed))
        (indexed xs)
       foldb id both prove
    <| (match domain with
         Small xs -> check (List.take maxSize xs) Proved
         Large _  ->
           check (Domain.sample maxSize domain) (Passed 1))

base.test.internals.v1.Test.label

.> view base.test.internals.v1.Test.label

  base.test.label : Text -> Test -> Test
  base.test.label n = cases
    Test k -> Test (scope -> k <| Scope.cons n scope)

base.test.internals.v1.Test.modifyScope

.> view base.test.internals.v1.Test.modifyScope

  base.test.internals.v1.Test.modifyScope :
    (Scope -> Scope) -> Test -> Test
  base.test.internals.v1.Test.modifyScope f = cases
    Test k -> Test ( k f)

base.test.internals.v1.Test.modifyStatus

.> view base.test.internals.v1.Test.modifyStatus

  base.test.internals.v1.Test.modifyStatus :
    (Status -> Status) -> Test -> Test
  base.test.internals.v1.Test.modifyStatus f = cases
    Test k -> Test ( (foldReport ( Report (Trie.map f))) k)

base.test.internals.v1.Test.passed

.> view base.test.internals.v1.Test.passed

  base.test.ok : Test
  base.test.ok =  finished Expected <| Passed 1

base.test.internals.v1.Test.passedUnexpectedly

.> view base.test.internals.v1.Test.passedUnexpectedly

  base.test.unexpected.ok : Test
  base.test.unexpected.ok =  finished Unexpected <| Passed 1

base.test.internals.v1.Test.passedWith

.> view base.test.internals.v1.Test.passedWith

  base.test.okWith : Text -> Test
  base.test.okWith m = label m passed

base.test.internals.v1.Test.pending

.> view base.test.internals.v1.Test.pending

  base.test.internals.v1.Test.pending : Test -> Test
  base.test.internals.v1.Test.pending =
    modifyStatus Status.pending

base.test.internals.v1.Test.proved

.> view base.test.internals.v1.Test.proved

  base.test.prove : Test
  base.test.prove = finished <| Expected Proved

base.test.internals.v1.Test.provedUnexpectedly

.> view base.test.internals.v1.Test.provedUnexpectedly

  base.test.unexpected.proven : Test
  base.test.unexpected.proven = finished <| Unexpected Proved

base.test.internals.v1.Test.provedWith

.> view base.test.internals.v1.Test.provedWith

  base.test.proveWith : Text -> Test
  base.test.proveWith m = label m prove

base.test.internals.v1.Test.report

.> view base.test.internals.v1.Test.report

  base.test.internals.v1.Test.report : Test -> Report
  base.test.internals.v1.Test.report = cases
    Test k -> k (Scope [])

base.test.internals.v1.Test.run

.> view base.test.internals.v1.Test.run

  base.test.run : Test -> [Result]
  base.test.run =  toCLIResult report

base.test.internals.v1.Test.runAll

.> view base.test.internals.v1.Test.runAll

  base.test.internals.v1.Test.runAll : [Test] -> [Result]
  base.test.internals.v1.Test.runAll = List.flatMap run

base.test.internals.v1.foldReport

.> view base.test.internals.v1.foldReport

  base.test.internals.v1.foldReport :
    (Trie Text Status ->{𝕖} r) -> Report ->{𝕖} r
  base.test.internals.v1.foldReport k = cases Report t -> k t

base.test.internals.v1.foldScope

.> view base.test.internals.v1.foldScope

  base.test.internals.v1.foldScope :
    ([Text] ->{𝕖} r) -> Scope ->{𝕖} r
  base.test.internals.v1.foldScope k = cases Scope ss -> k ss

base.test.internals.v1.foldStatus

.> view base.test.internals.v1.foldStatus

  base.test.internals.v1.foldStatus :
    r
    -> (Success ->{𝕖} r)
    -> (Success ->{𝕖} r)
    -> r
    -> Status
    ->{𝕖} r
  base.test.internals.v1.foldStatus
    failed expected unexpected pending = cases
    Failed       -> failed
    Expected s   -> expected s
    Unexpected s -> unexpected s
    Pending      -> pending

base.test.internals.v1.foldSuccess

.> view base.test.internals.v1.foldSuccess

  base.test.internals.v1.foldSuccess :
    (Nat ->{𝕖} r) -> r -> Success ->{𝕖} r
  base.test.internals.v1.foldSuccess passed proved = cases
    Passed n -> passed n
    Proved   -> proved

base.test.label

.> view base.test.label

  base.test.label : Text -> Test -> Test
  base.test.label n = cases
    Test k -> Test (scope -> k <| Scope.cons n scope)

base.test.laws.absorption

.> view base.test.laws.absorption

  base.test.laws.absorption :
    '{Gen} a
    -> (a ->{e} a ->{e} a)
    -> (a ->{e} a ->{e} a)
    ->{e, Gen} Test
  base.test.laws.absorption gen f g =
    x = !gen
    y = !gen
    expect ((f x (g x y) == x) && (g x (f x y) == x))

base.test.laws.associative

.> view base.test.laws.associative

  base.test.laws.associative :
    '{Gen} a -> (a ->{e} a ->{e} a) ->{e, Gen} Test
  base.test.laws.associative gen f =
    x = !gen
    y = !gen
    z = !gen
    expect (f x (f y z) == f (f x y) z)

base.test.laws.commutative

.> view base.test.laws.commutative

  base.test.laws.commutative :
    '{Gen} a -> (a ->{e} a ->{e} b) ->{e, Gen} Test
  base.test.laws.commutative gen f =
    x = !gen
    y = !gen
    expect (f x y == f y x)

base.test.laws.distributive

.> view base.test.laws.distributive

  base.test.laws.distributive :
    '{Gen} a
    -> (a ->{e} a ->{e} a)
    -> (a ->{e} a ->{e} a)
    ->{e, Gen} Test
  base.test.laws.distributive gen f g =
    x = !gen
    y = !gen
    z = !gen
    expect (f x (g y z) == g (f x y) (f x z))

base.test.laws.homomorphism

.> view base.test.laws.homomorphism

  base.test.laws.homomorphism :
    '{Gen} a
    -> (a ->{e} b)
    -> (a ->{e} a ->{e} a)
    -> (b ->{e} b ->{e} b)
    ->{e, Gen} Test
  base.test.laws.homomorphism gen f p q =
    a = !gen
    b = !gen
    expect (f (p a b) == q (f a) (f b))

base.test.laws.idempotence

.> view base.test.laws.idempotence

  base.test.laws.idempotence :
    '{Gen} a -> (a ->{e} a ->{e} a) ->{e, Gen} Test
  base.test.laws.idempotence gen f =
    x = !gen
    expect (f x x == x)

base.test.laws.lattice

.> view base.test.laws.lattice

  base.test.laws.lattice :
    '{Gen} a
    -> (a ->{e} a ->{e} a)
    -> (a ->{e} a ->{e} a)
    ->{e, Gen} Test
  base.test.laws.lattice gen meet join =
    use laws associative commutative
    both
      (both
        (both
          (both
            (laws.absorption gen meet join)
            (associative gen meet))
          (associative gen join))
        (commutative gen meet))
      (commutative gen join)

base.test.ok

.> view base.test.ok

  base.test.ok : Test
  base.test.ok =  finished Expected <| Passed 1

base.test.okWith

.> view base.test.okWith

  base.test.okWith : Text -> Test
  base.test.okWith m = label m passed

base.test.pick

.> view base.test.pick

  base.test.pick : ['{Gen} a] -> '{Gen} a
  base.test.pick gs =
    merge : '{Gen} a -> '{Gen} a -> '{Gen} a
    merge g1 g2 _ = toWeighted g1 <|> toWeighted g2 |> Gen.sample
    foldb id merge gen.empty gs

base.test.prove

.> view base.test.prove

  base.test.prove : Test
  base.test.prove = finished <| Expected Proved

base.test.proveWith

.> view base.test.proveWith

  base.test.proveWith : Text -> Test
  base.test.proveWith m = label m prove

base.test.run

.> view base.test.run

  base.test.run : Test -> [Result]
  base.test.run =  toCLIResult report

base.test.runs

.> view base.test.runs

  base.test.runs : Nat -> '{e, Gen} Test ->{e} [Result]
  base.test.runs n ts = run <| tests (test.sample n ts)

base.test.sample

.> view base.test.sample

  base.test.sample : Nat -> '{e, Gen} a ->{e} [a]
  base.test.sample n g = Weighted.sample n (toWeighted g)

base.test.setOf

.> view base.test.setOf

  base.test.setOf : '{Gen} a -> '{Gen} Set a
  base.test.setOf a = '(Set.fromList !(listOf a))

base.test.tests

.> view base.test.tests

  base.test.tests : [Test] -> Test
  base.test.tests = cases
    []      -> passed
    h +: ts -> List.foldl both h ts

base.test.unexpected.ok

.> view base.test.unexpected.ok

  base.test.unexpected.ok : Test
  base.test.unexpected.ok =  finished Unexpected <| Passed 1

base.test.unexpected.proven

.> view base.test.unexpected.proven

  base.test.unexpected.proven : Test
  base.test.unexpected.proven = finished <| Unexpected Proved

base.todo

.> view base.todo

  -- base.todo is built-in.

base.until

.> view base.until

  base.until : (a ->{e} Boolean) -> '{e} a ->{e} a
  base.until pred op =
    r = !op
    if pred r then r else base.until pred op

base.until.test

.> view base.until.test

  base.until.test : [Result]
  base.until.test =
    use withInitialValue handler
    go n _ =
      new =
        use Nat +
        get + 1
      put new
      new == n
    t3 =
      handle expect ((until id (go 3)) && (get == 3))
      with handler 0
    t1 =
      handle expect ((until id (go 1)) && (get == 1))
      with handler 0
    run (both t1 t3)

base.while

.> view base.while

  base.while : (a ->{e} Boolean) -> '{e} a ->{e} a
  base.while pred op = until ( not pred) op

base.while.test

.> view base.while.test

  base.while.test : [Result]
  base.while.test =
    use withInitialValue handler
    go n _ =
      new =
        use Nat +
        get + 1
      put new
      new < n
    t3 =
      handle expect ((not (while id (go 3))) && (get == 3))
      with handler 0
    t1 =
      handle expect ((not (while id (go 1))) && (get == 1))
      with handler 0
    run (both t1 t3)

base.|>

.> view base.|>

  (base.|>) : a -> (a ->{𝕖} b) ->{𝕖} b
  a base.|> f = f a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment