This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main | |
isZ : Nat -> Bool | |
isZ Z = True | |
isZ _ = False | |
main : IO () | |
main = do | |
print $ fromIntegerNat (-1) | |
print $ isZ $ fromIntegerNat (-1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
module Sdl where | |
import Control.Monad (when) | |
import qualified SDL | |
import SDL.Vect | |
import SDL (($=)) | |
import Foreign.C.Types | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*agdai | |
MAlonzo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.ibc | |
*.idr~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[pg/etext92/carol10.txt] | |
A CHRISTMAS CAROL | |
by Charles Dickens | |
I have endeavoured in this Ghostly little book, | |
to raise the Ghost of an Idea, which shall not put my | |
readers out of humour with themselves, with each other, | |
with the season, or with me. May it haunt their houses |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Monad (replicateM) | |
import System.Random | |
import Test.QuickCheck | |
-- Exercise 1 | |
fib :: Integer -> Integer | |
fib 0 = 1 | |
fib 1 = 1 | |
fib n = fib (n-1) + fib (n-2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(shape). | |
-export([area/1, perimeter/1, bits/1]). | |
area({rectangle,{_, _}, W, H}) when (0<W) and (0<H) -> W*H; | |
area({circle,{_, _}, R}) when (R>0) -> R*R*math:pi(); | |
area({triangle,A, B, C}) when (A>0) and (B>0) and (C>0) -> heron(A, B, C). | |
heron(A,B,C) -> | |
S = (A + B + C)/2, | |
math:sqrt(S*(S-A)*(S-B)*(S-C)). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Test.Hspec | |
import Test.QuickCheck | |
sqr :: Integer -> Integer | |
sqr n = n * n | |
squareNumberIsGreaterOrEqualToZero :: Integer -> Bool | |
squareNumberIsGreaterOrEqualToZero n = sqr n >= 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
import CodeWorld | |
import Data.Foldable | |
character, wall, ground, storage, box :: Picture | |
wall = colored (grey 0.4) (solidRectangle 1 1) | |
ground = colored yellow (solidRectangle 1 1) | |
storage = solidCircle 0.3 & ground | |
box = colored brown (solidRectangle 1 1) | |
character = colored green $ solidCircle 0.2 & translated 0.2 0 (solidCircle 0.1) |
NewerOlder