Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Modeling algebraic understanding with Haskell in KS1
-- Modeling algebraic understanding with Haskell in KS1 -- remove the two minuses to uncomment -- (c) Sociality Mathematics CIC, 2017 Creative Commons Licence CC-BY-SA 3.0 -- activity 1: Enter the code below into your IDE or run it here data Colour = NaC | White | Red | Green | Purple | Yellow | DarkGreen | Black | Brown | Blue | Orange deriving (Show,Eq, Ord,Enum) -- What do you think will happen when you run this here main = print (succ White) -- or load this code into the interpreter and ask it succ White? -- make up your own questions using pred, succ and $ (for function composition) and check -- activity 2: In pairs, edit the Colour datatype above so that one person has a model of the even staircase and the other the odd -- data Colour = NaC | Red | Purple | DarkGreen | Brown | Orange deriving (Show,Eq, Ord,Enum) -- data Colour = White | Green Yellow | Black | Blue deriving (Show,Eq, Ord,Enum) -- write a test of your model and see if it works -- for example in the odd staircase succ Red -> Error -- activity 3: using equivalences for the trains of one colour equivalent to a rod and choosing a unit of measure for the White rod define constant functions for the letter codes and test your calculator
run
|
edit
|
history
|
help
0
project euler 8, haskell
haskell linked list
Pi
Lambda Parser with long ids
Pascal's triangle in 10 lines
Kleintjes
=)
(Int,Int) -> Bool plot
boolean functions of zero arguments in haskell
divisibleBy a b