codeworld-base-0.1.0.0: Replacement base module for CodeWorld

Safe HaskellNone
LanguageHaskell98

Prelude

Contents

Description

The standard set of functions and variables available to all programs.

You may use any of these functions and variables without defining them.

Synopsis

Documentation

Welome to CodeWorld! You can define your own pictures, animations, and games by defining variables and functions. There are four kinds of CodeWorld programs:

  • Pictures. To create a picture, you'll define the variable called main using pictureOf. The parameter to pictureOf should be a Picture. Example:
main = pictureOf(tree)
  • Animations. To create an animation, you'll define the variable called main using animationOf. The parameter to animationOf should be a function, mapping each time in seconds (a Number) to a Picture that is shown at that time. Example:
main = animationOf(spinningWheel)
  • Simulations. A simulation is like an animation, in that it changes over time. But while an animation changes in a simple regular way over time, a simulation can change in different ways depending on the state of things at any moment. To create a simulation, you should first decide on the type to describe the state of things (called the "world" type), and describe the simulation in terms of the starting state, the step that says how things change over time, and and a draw function that can build a picture from a state. Then you'll use simulationOf to define main. Example:
main = simulationOf(start, step, draw)
  • Interactions. Finally, you can build an interactive simulation, such as a game. This is very like a simulation, except that it also has an event function, which says how the state of things changes when events (like keys being pressed or the mouse moving) happen. You'll use interactionOf to define these. Example:
main = interactionOf(start, step, event, draw)

Numbers

data Number

The type for numbers.

Numbers can be positive or negative, whole or fractional. For example, 5, 3.2, and -10 are all values of the type Number.

(+) :: Number -> Number -> Number infixl 6

Adds two numbers.

(-) :: Number -> Number -> Number infixl 6

Subtracts two numbers.

(*) :: Number -> Number -> Number infixl 7

Multiplies two numbers.

(/) :: Number -> Number -> Number infixl 7

Divides two numbers. The second number should not be zero.

(^) :: Number -> Number -> Number infixr 8

Raises a number to a power.

(>) :: Number -> Number -> Bool infix 4

Tells whether one number is greater than the other.

(>=) :: Number -> Number -> Bool infix 4

Tells whether one number is greater than or equal to the other.

(<) :: Number -> Number -> Bool infix 4

Tells whether one number is less than the other.

(<=) :: Number -> Number -> Bool infix 4

Tells whether one number is less than or equal to the other.

max :: (Number, Number) -> Number

Gives the larger of two numbers.

min :: (Number, Number) -> Number

Gives the smaller of two numbers.

negate :: Number -> Number

Gives the opposite (that is, the negative) of a number.

abs :: Number -> Number

Gives the absolute value of a number.

If the number if positive or zero, the absolute value is the same as the number. If the number is negative, the absolute value is the opposite of the number.

signum :: Number -> Number

Gives the sign of a number.

If the number is negative, the signum is -1. If it's positive, the signum is 1. If the number is 0, the signum is 0. In general, a number is equal to its absolute value (abs) times its sign (signum).

truncate :: Number -> Number

Gives the number without its fractional part.

For example, truncate(4.2) is 4, while truncate(-4.7) is -4.

round :: Number -> Number

Gives the number rounded to the nearest integer.

For example, round(4.2) is 4, while round(4.7) is 5.

ceiling :: Number -> Number

Gives the smallest integer that is greater than or equal to a number.

For example, ceiling(4) is 4, while ceiling(4.1) is 5. With negative numbers, ceiling(-3.5) is -3, since -3 is greater than -3.5.

floor :: Number -> Number

Gives the largest integer that is less than or equal to a number.

For example, floor(4) is 4, while floor(3.9) is 3. With negative numbers, floor(-3.5) is -4, since -4 is less than -3.5.

quotient :: (Number, Number) -> Number

Gives the integer part of the result when dividing two numbers.

For example, 3/2 is 1.5, but quotient(3, 2) is 1, which is the integer part.

remainder :: (Number, Number) -> Number

Gives the remainder when dividing two numbers.

For example, remainder(3,2) is 1, which is the remainder when dividing 3 by 2.

reciprocal :: Number -> Number

Gives the repicrocal of a number.

For example, reciprocal(5) is 1/5 (also written as 0.2).

pi :: Number

The constant pi, which is equal to the ration between the circumference and diameter of a circle.

pi is approximately 3.14159.

exp :: Number -> Number

Gives the exponential of a number. This is equal to the constant e, raised to the power of the number.

The exp function increases faster and faster very quickly. For example, if t is the current time in seconds, exp(t) will reach a million in about 14 seconds. It will reach a billion in around 21 seconds.

sqrt :: Number -> Number

Gives the square root of a number. This is the positive number that, when multiplied by itself, gives the original number back.

The sqrt always increases, but slows down. For example, if t is the current time, sqrt(t) will reach 5 in 25 seconds. But it will take 100 seconds to reach 10, and 225 seconds (almost 4 minutes) to reach 15.

log :: Number -> Number

Gives the natural log of a number. This is the opposite of the exp function.

Like sqrt, the log function always increases, but slows down. However, it slows down much sooner than the sqrt function. If t is the current time in seconds, it takes more than 2 minutes for log(t) to reach 5, and more than 6 hours to reach 10!

logBase :: (Number, Number) -> Number

Gives the logarithm of the first number, using the base of the second number.

sin :: Number -> Number

Gives the sine of an angle, where the angle is measured in degrees.

tan :: Number -> Number

Gives the tangent of an angle, where the angle is measured in degrees.

This is the slope of a line at that angle from horizontal.

cos :: Number -> Number

Gives the cosine of an angle, where the angle is measured in degrees.

asin :: Number -> Number

Gives the inverse sine of a value, in degrees.

This is the unique angle between -90 and 90 that has the input as its sine.

atan :: Number -> Number

Gives the inverse tangent of a value, in degrees.

This is the unique angle between -90 and 90 that has the input as its tangent.

atan2 :: (Number, Number) -> Number

Gives the angle between the positive x axis and a given point, in degrees.

acos :: Number -> Number

Gives the inverse cosine of a value, in degrees.

This is the unique angle between 0 and 180 that has the input as its cosine.

properFraction :: Number -> (Number, Number)

Separates a number into its whole and fractional parts.

For example, properFraction(1.2) is (1, 0.2).

even :: Number -> Bool

Tells if a number is even.

odd :: Number -> Bool

Tells if a number is odd.

gcd :: (Number, Number) -> Number

Gives the greatest common divisor of two numbers.

This is the largest number that divides each of the two parameters. Both parameters must be integers.

lcm :: (Number, Number) -> Number

Gives the least common multiple of two numbers.

This is the smallest number that is divisible by both of the two parameters. Both parameters must be integers.

sum :: [Number] -> Number

Gives the sum of a list of numbers.

product :: [Number] -> Number

Gives the product of a list of numbers.

maximum :: [Number] -> Number

Gives the largest number from a list.

minimum :: [Number] -> Number

Gives the smallest number from a list.

isInteger :: Number -> Bool

Tells whether a Number is an integer or not.

An integer is a whole number, such as 5, 0, or -10. Numbers with non-zero decimals, like 5.3, are not integers.

Text

data Text :: *

A space efficient, packed, unboxed Unicode text type.

Instances

Eq Text 
Data Text

This instance preserves data abstraction at the cost of inefficiency. We omit reflection services for the sake of data abstraction.

This instance was created by copying the updated behavior of Data.Set.Set and Data.Map.Map. If you feel a mistake has been made, please feel free to submit improvements.

The original discussion is archived here: could we get a Data instance for Data.Text.Text?

The followup discussion that changed the behavior of Set and Map is archived here: Proposal: Allow gunfold for Data.Map, ...

Ord Text 
Read Text 
Show Text 
IsString Text 
ToJSON Text 
FromJSON Text 
Monoid Text 
NFData Text 
ToJSString Text 
FromJSString Text 
Typeable * Text 
ToJSON v => ToJSON (HashMap Text v) 
ToJSON v => ToJSON (Map Text v) 
FromJSON v => FromJSON (HashMap Text v) 
FromJSON v => FromJSON (Map Text v) 

append :: (Text, Text) -> Text

(<>) :: Text -> Text -> Text infixr 6

lines :: Text -> [Text]

O(n) Breaks a Text up into a list of Texts at newline Chars. The resulting strings do not contain newlines.

words :: Text -> [Text]

O(n) Breaks a Text up into a list of words, delimited by Chars representing white space.

unlines :: [Text] -> Text

O(n) Joins lines, after appending a terminating newline to each.

unwords :: [Text] -> Text

O(n) Joins words using single space characters.

join :: ([Text], Text) -> Text

replace :: (Text, Text, Text) -> Text

Replaces one piece of text with another.

For example, `replace("How do you do?", "do", "be")` is equal to `"How be you be?"`.

toLower :: Text -> Text

O(n) Convert a string to lower case, using simple case conversion. Subject to fusion.

The result string may be longer than the input string. For instance, "İ" (Latin capital letter I with dot above, U+0130) maps to the sequence "i" (Latin small letter i, U+0069) followed by " ̇" (combining dot above, U+0307).

toUpper :: Text -> Text

O(n) Convert a string to upper case, using simple case conversion. Subject to fusion.

The result string may be longer than the input string. For instance, the German "ß" (eszett, U+00DF) maps to the two-letter sequence "SS".

strip :: Text -> Text

O(n) Remove leading and trailing white space from a string. Equivalent to:

dropAround isSpace

stripPrefix :: (Text, Text) -> Text

Removes a prefix from some text.

For example, `stripPrefix("Dr. Jones", "Dr. ")` is equal to `Jones`. If the prefix isn't there, the result is the same string, unchanged.

stripSuffix :: (Text, Text) -> Text

Removes a suffix from some text.

For example, `stripSuffix("smallest", "est")` is equal to `"small"`. If the suffix isn't there, the result is the same string, unchanged.

search :: (Text, Text) -> [Number]

Finds all indices where some text appears in a larger piece of text.

For example, `search("How do you do?", "do")` is equal to the list `[4, 11]`. Indices start at zero.

substring :: (Text, Number, Number) -> Text

Takes part of a string at a starting index and length.

For example, `substring("funny", 2, 2)` is equal to `"nn"`. Indices start at zero.

General purpose functions

data Bool :: *

Constructors

False 
True 

Instances

Bounded Bool 
Enum Bool 
Eq Bool 
Data Bool 
Ord Bool 
Read Bool 
Show Bool 
Ix Bool 
Generic Bool 
ToJSON Bool 
FromJSON Bool 
Storable Bool 
Bits Bool 
FiniteBits Bool 
Random Bool 
Typeable * Bool 
type Rep Bool = D1 D1Bool ((:+:) (C1 C1_0Bool U1) (C1 C1_1Bool U1)) 
type (==) Bool a b = EqBool a b 

(&&) :: Bool -> Bool -> Bool infixr 3

Boolean "and"

(||) :: Bool -> Bool -> Bool infixr 2

Boolean "or"

not :: Bool -> Bool

Boolean "not"

otherwise :: Bool

otherwise is defined as the value True. It helps to make guards more readable. eg.

 f x | x < 0     = ...
     | otherwise = ...

data Maybe a :: * -> *

The Maybe type encapsulates an optional value. A value of type Maybe a either contains a value of type a (represented as Just a), or it is empty (represented as Nothing). Using Maybe is a good way to deal with errors or exceptional cases without resorting to drastic measures such as error.

The Maybe type is also a monad. It is a simple kind of error monad, where all errors are represented by Nothing. A richer error monad can be built using the Either type.

Constructors

Nothing 
Just a 

Instances

Alternative Maybe 
Monad Maybe 
Functor Maybe 
MonadFix Maybe 
MonadPlus Maybe 
Applicative Maybe 
Foldable Maybe 
Traversable Maybe 
Generic1 Maybe 
Eq a => Eq (Maybe a) 
Data a => Data (Maybe a) 
Ord a => Ord (Maybe a) 
Read a => Read (Maybe a) 
Show a => Show (Maybe a) 
Generic (Maybe a) 
ToJSON a => ToJSON (Maybe a) 
FromJSON a => FromJSON (Maybe a) 
Monoid a => Monoid (Maybe a)

Lift a semigroup into Maybe forming a Monoid according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be turned into a monoid simply by adjoining an element e not in S and defining e*e = e and e*s = s = s*e for all s ∈ S." Since there is no "Semigroup" typeclass providing just mappend, we use Monoid instead.

(Selector s, ToJSON a) => RecordToPairs (S1 s (K1 i (Maybe a))) 
(Selector s, FromJSON a) => FromRecord (S1 s (K1 i (Maybe a))) 
Typeable (* -> *) Maybe 
type Rep1 Maybe = D1 D1Maybe ((:+:) (C1 C1_0Maybe U1) (C1 C1_1Maybe (S1 NoSelector Par1))) 
type Rep (Maybe a) = D1 D1Maybe ((:+:) (C1 C1_0Maybe U1) (C1 C1_1Maybe (S1 NoSelector (Rec0 a)))) 
type (==) (Maybe k) a b = EqMaybe k a b 

withDefault :: (Maybe a, a) -> a

Converts a Maybe value to a plain value, by using a default.

For example, `withDefault(Nothing, 5)` is equal to 5, while `withDefault(Just(3), 5)` is equal to 3.

maybe :: (Maybe a, a -> b, b) -> b

Gets a value from a Maybe value by applying either a default value or another function.

For example, `maybe(Nothing, blank, circle)` is a picture, while `maybe(Just(10), blank, circle)` is a picture of a circle with radius 10.

data Either a b :: * -> * -> *

The Either type represents values with two possibilities: a value of type Either a b is either Left a or Right b.

The Either type is sometimes used to represent a value which is either correct or an error; by convention, the Left constructor is used to hold an error value and the Right constructor is used to hold a correct value (mnemonic: "right" also means "correct").

Constructors

Left a 
Right b 

Instances

Error e => Alternative (Either e) 
Monad (Either e) 
Functor (Either a) 
MonadFix (Either e) 
Error e => MonadPlus (Either e) 
Applicative (Either e) 
Foldable (Either a) 
Traversable (Either a) 
Generic1 (Either a) 
(Eq a, Eq b) => Eq (Either a b) 
(Data a, Data b) => Data (Either a b) 
(Ord a, Ord b) => Ord (Either a b) 
(Read a, Read b) => Read (Either a b) 
(Show a, Show b) => Show (Either a b) 
Generic (Either a b) 
(ToJSON a, ToJSON b) => ToJSON (Either a b) 
(FromJSON a, FromJSON b) => FromJSON (Either a b) 
Typeable (* -> * -> *) Either 
type Rep1 (Either a) = D1 D1Either ((:+:) (C1 C1_0Either (S1 NoSelector (Rec0 a))) (C1 C1_1Either (S1 NoSelector Par1))) 
type Rep (Either a b) = D1 D1Either ((:+:) (C1 C1_0Either (S1 NoSelector (Rec0 a))) (C1 C1_1Either (S1 NoSelector (Rec0 b)))) 
type (==) (Either k k1) a b = EqEither k k1 a b 

either :: (Either a b, a -> c, b -> c) -> c

Gets a value from an Either value by applying either of two functions, depending on if the value is the left or right possibility.

For example, `either(Left(5), circle, text)` is a circle with radius 5. But `either(Right("hello"), circle, text)` is a picture with the text `"hello"`.

(==) :: a -> a -> Bool

(/=) :: a -> a -> Bool

fst :: (a, b) -> a

Extract the first component of a pair.

snd :: (a, b) -> b

Extract the second component of a pair.

toOperator :: ((a, b) -> c) -> a -> b -> c

Converts a function to an operator.

Example use:

f(x,y) = 2*x + y (%) = toOperator(f)

eight = 3 % 2

This has the same effect as defining % as:

x % y = 2*x + y eight = 3 % 2

fromOperator :: (a -> b -> c) -> (a, b) -> c

Converts an operator into a normal function.

Example use:

divide = fromOperator(/) four = divide(16, 4)

id :: a -> a

Identity function.

const :: a -> b -> a

Constant function.

(.) :: (b -> c) -> (a -> b) -> a -> c infixr 9

Function composition.

flip :: ((a, b) -> c) -> (b, a) -> c

Converts a function into a version that takes the arguments in the opposite order.

Example:

f(x,y) = 2*x + y g = flip(f) eight = g(2,3)

until :: (a -> Bool, a -> a, a) -> a

Continues passing a value through a function until it meets a condition.

Example:

seven = until(odd, (/ 2), 56)

error :: Text -> a

undefined :: a

A special case of error. It is expected that compilers will recognize this and insert error messages which are more appropriate to the context in which undefined appears.

ifThenElse :: Bool -> a -> a -> a

map :: (a -> b, [a]) -> [b]

Applies a function to each element of a list, and produces a list of results.

For example, `map(circle, [1, 2, 3, 4, 5])` is a list of circles of different sizes.

(++) :: [a] -> [a] -> [a] infixr 5

Append two lists, i.e.,

[x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]
[x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]

If the first list is not finite, the result is the first list.

filter :: (a -> Bool, [a]) -> [a]

Keeps only the elements of a list for which a function evaluates to True.

For example, `filter(even, [1, 2, 3, 4, 5])` is equal to `[2, 4]`.

reduce :: ((a, a) -> a, [a]) -> a

Reduces a list of values into a single value, by combining elements with a function. The function should take two parameters, and should be associative (so `f(x,f(y,z)) = f(f(x,y),z)`). The list should be non-empty.

For example, `reduce(fromOperator(+), [1, 3, 5])` is equal to `9`.

first :: [a] -> a

rest :: [a] -> [a]

init :: [a] -> [a]

Return all the elements of a list except the last one. The list must be non-empty.

last :: [a] -> a

Extract the last element of a list, which must be finite and non-empty.

null :: [a] -> Bool

Test whether a list is empty.

length :: [a] -> Number

(!!) :: [a] -> Number -> a

reverse :: [a] -> [a]

reverse xs returns the elements of xs in reverse order. xs must be finite.

and :: [Bool] -> Bool

and returns the conjunction of a Boolean list. For the result to be True, the list must be finite; False, however, results from a False value at a finite index of a finite or infinite list.

or :: [Bool] -> Bool

or returns the disjunction of a Boolean list. For the result to be False, the list must be finite; True, however, results from a True value at a finite index of a finite or infinite list.

any :: ([a], a -> Bool) -> Bool

Determines if any member of a list matches a condition.

For example, `any([1, 2, 3], even)` is True, because 2 is even.

all :: ([a], a -> Bool) -> Bool

Determines if all members of a list match a condition.

For example, `all([2, 3, 4], even)` is False, because 3 is not even.

concat :: [[a]] -> [a]

Concatenate a list of lists.

concatMap :: ([a], a -> [b]) -> [b]

Builds a list from all of the members in the lists produced by applying a function to each element of the given list.

repeat :: a -> [a]

repeat x is an infinite list, with x the value of every element.

replicate :: (a, Number) -> [a]

cycle :: [a] -> [a]

cycle ties a finite list into a circular one, or equivalently, the infinite repetition of the original list. It is the identity on infinite lists.

take :: ([a], Number) -> [a]

drop :: ([a], Number) -> [a]

splitAt :: ([a], Number) -> ([a], [a])

takeWhile :: (a -> Bool) -> [a] -> [a]

takeWhile, applied to a predicate p and a list xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p:

takeWhile (< 3) [1,2,3,4,1,2,3,4] == [1,2]
takeWhile (< 9) [1,2,3] == [1,2,3]
takeWhile (< 0) [1,2,3] == []

dropWhile :: (a -> Bool) -> [a] -> [a]

dropWhile p xs returns the suffix remaining after takeWhile p xs:

dropWhile (< 3) [1,2,3,4,5,1,2,3] == [3,4,5,1,2,3]
dropWhile (< 9) [1,2,3] == []
dropWhile (< 0) [1,2,3] == [1,2,3]

span :: (a -> Bool) -> [a] -> ([a], [a])

span, applied to a predicate p and a list xs, returns a tuple where first element is longest prefix (possibly empty) of xs of elements that satisfy p and second element is the remainder of the list:

span (< 3) [1,2,3,4,1,2,3,4] == ([1,2],[3,4,1,2,3,4])
span (< 9) [1,2,3] == ([1,2,3],[])
span (< 0) [1,2,3] == ([],[1,2,3])

span p xs is equivalent to (takeWhile p xs, dropWhile p xs)

break :: (a -> Bool) -> [a] -> ([a], [a])

break, applied to a predicate p and a list xs, returns a tuple where first element is longest prefix (possibly empty) of xs of elements that do not satisfy p and second element is the remainder of the list:

break (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])
break (< 9) [1,2,3] == ([],[1,2,3])
break (> 9) [1,2,3] == ([1,2,3],[])

break p is equivalent to span (not . p).

isMember :: ([a], a) -> Bool

lookup :: ([(a, b)], a) -> Maybe b

transpose :: [[a]] -> [[a]]

The transpose function transposes the rows and columns of its argument. For example,

transpose [[1,2,3],[4,5,6]] == [[1,4],[2,5],[3,6]]

subsequences :: [a] -> [[a]]

The subsequences function returns the list of all subsequences of the argument.

subsequences "abc" == ["","a","b","ab","c","ac","bc","abc"]

permutations :: [a] -> [[a]]

The permutations function returns the list of all permutations of the argument.

permutations "abc" == ["abc","bac","cba","bca","cab","acb"]

nub :: [a] -> [a]

sort :: [Number] -> [Number]

shuffle :: ([a], Number) -> [a]

data IO a :: * -> *

A value of type IO a is a computation which, when performed, does some I/O before returning a value of type a.

There is really only one way to "perform" an I/O action: bind it to Main.main in your program. When your program is run, the I/O will be performed. It isn't possible to perform I/O from an arbitrary function, unless that function is itself in the IO monad and called at some point, directly or indirectly, from Main.main.

IO is a monad, so IO actions can be combined using either the do-notation or the >> and >>= operations from the Monad class.

Instances

Alternative IO 
Monad IO 
Functor IO 
MonadFix IO 
MonadPlus IO 
Applicative IO 
MonadIO IO 
MonadRandom IO 
MonadSplit StdGen IO 
(~) * a () => PrintfType (IO a) 
(~) * a () => HPrintfType (IO a) 
Typeable (* -> *) IO 

data Number

The type for numbers.

Numbers can be positive or negative, whole or fractional. For example, 5, 3.2, and -10 are all values of the type Number.

data Text :: *

A space efficient, packed, unboxed Unicode text type.

Instances

Eq Text 
Data Text

This instance preserves data abstraction at the cost of inefficiency. We omit reflection services for the sake of data abstraction.

This instance was created by copying the updated behavior of Data.Set.Set and Data.Map.Map. If you feel a mistake has been made, please feel free to submit improvements.

The original discussion is archived here: could we get a Data instance for Data.Text.Text?

The followup discussion that changed the behavior of Set and Map is archived here: Proposal: Allow gunfold for Data.Map, ...

Ord Text 
Read Text 
Show Text 
IsString Text 
ToJSON Text 
FromJSON Text 
Monoid Text 
NFData Text 
ToJSString Text 
FromJSString Text 
Typeable * Text 
ToJSON v => ToJSON (HashMap Text v) 
ToJSON v => ToJSON (Map Text v) 
FromJSON v => FromJSON (HashMap Text v) 
FromJSON v => FromJSON (Map Text v) 

shuffle :: ([a], Number) -> [a]

Colors

newtype Color

Constructors

RGBA (Number, Number, Number, Number) 

Instances

Pictures

type Point = (Number, Number)

type Vector = (Number, Number)

data Picture

Instances

(&) :: Picture -> Picture -> Picture infixr 0

coordinatePlane :: Picture

A coordinate plane. Adding this to your pictures can help you measure distances more accurately.

Example:

main = pictureOf(myPicture & coordinatePlane) myPicture = ...

codeWorldLogo :: Picture

The CodeWorld logo.

Events

data Event

An event initiated by the user.

Values of this type represent events that the user triggers when using an interaction, defined with interactionOf.

Key events describe the key as Text. Most keys are represented by a single character text string, with the capital letter or other symbol from the key. Keys that don't correspond to a single character use longer names from the following list. Keep in mind that not all of these keys appear on all keyboards.

  • Up, Down, Left, and Right for the cursor keys.
  • F1, F2, etc. for function keys.
  • Backspace
  • Tab
  • Enter
  • Shift
  • Ctrl
  • Alt
  • Esc
  • PageUp
  • PageDown
  • End
  • Home
  • Insert
  • Delete
  • CapsLock
  • NumLock
  • ScrollLock
  • PrintScreen
  • Break
  • Separator
  • Cancel
  • Help

Instances

Debugging

trace :: (a, Text) -> a

Entry points

type Program = IO ()

simulationOf :: ([Number] -> a, (a, Number) -> a, a -> Picture) -> Program

interactionOf :: ([Number] -> a, (a, Number) -> a, (a, Event) -> a, a -> Picture) -> Program