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 SwiftUI | |
let LINE_LENGTH: Double = 500.0 | |
let N = 720 | |
let LINES = 18 | |
let WAVES: Double = 18.0 | |
let WAVE_HEIGHT: Double = 20 | |
let SPACING: Double = 27.0 | |
let CURL_AMOUNT: Double = 12.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
// Colors reference | |
// You can use the following as so: | |
// console.log(colorCode, data); | |
// console.log(`${colorCode}some colorful text string${resetCode} rest of string in normal color`); | |
// | |
// ... and so on. | |
export const reset = "\x1b[0m" | |
export const bright = "\x1b[1m" | |
export const dim = "\x1b[2m" |
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 WriterMonad where | |
-- From http://learnyouahaskell.com/for-a-few-monads-more | |
-- This example no longer works without tweaking - see | |
-- http://stackoverflow.com/questions/11684321/how-to-play-with-control-monad-writer-in-haskell | |
-- just replace the data constructor "Writer" with the function "writer" in the line marked "here" | |
-- That changed with mtl going from major version 1.* to 2.*, shortly after LYAH and RWH were written | |
import Control.Monad.Writer | |
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 MyList where | |
data MyList a = Cons a (MyList a) | |
| MyNil deriving (Show, Eq) | |
{- | |
A simple linked list module | |
Some examples: | |
mylist = (Cons 10 (Cons 99 (Cons 11 (Cons 1 MyNil)))) | |
myHead myList # => 10 | |
myTail myList # => Cons 99 (Cons 11 (Cons 1 MyNil)) |