Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

First version of prelude #10

Open
jonhue opened this issue Feb 9, 2021 · 1 comment
Open

First version of prelude #10

jonhue opened this issue Feb 9, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@jonhue
Copy link
Member

jonhue commented Feb 9, 2021

type Void = Void
type Nothing = ()
type Maybe(T) = nothing | just(T)
type Either(T, U) = left(T) | right(U)
type Const(T, U) = const(T)
type Identity(T) = identity(T)

type Map(T, U) = [(T, U)]

type IO(T) = io(T)

io->print :: <T <: Show> T -> IO(Nothing)
io->input :: () -> IO(String)

- :: Number -> Number
! :: T -> Boolean
^ :: Number -> Number -> Number
* :: Number -> Number -> Number
/ :: Number -> Number -> Number
+ :: Number -> Number -> Number
- :: Number -> Number -> Number
% :: Number -> Number -> Number
< :: Number -> Number -> Number
<= :: Number -> Number -> Number
> :: Number -> Number -> Number
>= :: Number -> Number -> Number
== :: T -> T -> Boolean
!= :: T -> T -> Boolean
=== :: T -> T -> Boolean
!== :: T -> T -> Boolean
&& :: T -> U -> Boolean
|| :: T -> U -> Boolean
==> :: T -> U -> Boolean
<=> :: T -> U -> Boolean

. :: T -> (T -> U) -> U
&. ::  T? -> (T -> U) -> U?
o :: (U -> V) -> (T -> U) -> (T -> V)
-> :: <U <: @T> T -> U -> T[U]

to_boolean :: String -> Boolean
to_number :: String -> Number
to_string :: T -> String

abs :: Number -> Number

unit :: ()
absurd :: Void -> T

Follow-ups:

  • monads
  • kleisli
  • functors
  • bifunctors
  • applicatives
  • monoid type structure
@jonhue jonhue added the enhancement New feature or request label Feb 9, 2021
@jonhue
Copy link
Member Author

jonhue commented Feb 17, 2021

first idea for a stdlib https://github.com/jonhue/quik/issues/58

@jonhue jonhue added this to Core Nov 19, 2021
@jonhue jonhue moved this to Todo in Core Nov 19, 2021
@jonhue jonhue moved this from Todo to Processing in Core Nov 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
Status: Processing
Development

No branches or pull requests

1 participant