This file contains hidden or 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
| ---- Put it together and show it ---- | |
| main = lift3 presentation sunAndEarth bouncingBall sineGraph | |
| presentation figure1 figure2 f3 = | |
| flow down [ figure1, figure2, f3 ] | |
| -- Signal.foldp : (a -> b -> b) -> b -> Signal a -> Signal b |
This file contains hidden or 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
| class Misty m where | |
| banana :: (a -> m b) -> m a -> m b | |
| unicorn :: a -> m a | |
| -- Exercise 6 | |
| -- Relative Difficulty: 3 | |
| -- (use banana and/or unicorn) | |
| furry' :: (a -> b) -> m a -> m b | |
| furry' = banana . (unicorn .) | |
| instance Misty ((->) t) where |
This file contains hidden or 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
| data Id a | |
| runId :: Id a -> a | |
| mapId :: (a -> b) -> Id a -> Id b | |
| bindId :: (a -> Id b) -> Id a -> Id b | |
| data List t = Nil | t :. (List t) | |
| infinity :: List Integer | |
| foldRight :: (a -> b -> b) -> b -> List a -> b | |
| foldLeft :: (b -> a -> b) -> b -> List a -> b |
This file contains hidden or 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
| instance Apply (State s) where | |
| -- Apply f ⇒ (<*>) :: f (a -> b) -> f a -> f b | |
| -- Apply (State s) ⇒ (<*>) :: State s (a -> b) -> State s a -> State s b | |
| --sab <*> sa = (\f → f <$> sa) <$> sab | |
| sab <*> sa = | |
| let | |
| fsab = runState sab -- ∷ s → (a → b, s) | |
| fsa = runState sa -- ∷ s → (a, s) | |
| apply s = | |
| let |
This file contains hidden or 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
| package slickdemo | |
| import scala.reflect.macros.Context | |
| import scala.language.experimental.macros | |
| object Macros { | |
| // scala.reflect.runtime.currentMirror | |
| // universe.reify |
This file contains hidden or 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
| instance Apply MaybeListZipper where | |
| (IsZ l) <*> (IsZ r) = IsZ $ l <*> r | |
| _ <*> _ = IsNotZ | |
| Build FAILED | |
| /Users/pedrofurla/dev/projects/nicta-fp-course/src/Course/ListZipper.hs: line 605, column 31: | |
| Ambiguous occurrence `<*>' | |
| It could refer to either `Course.ListZipper.<*>', |
This file contains hidden or 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
| hardCoreFunction a b c = | |
| let z = a + b | |
| k = b + c | |
| in | |
| error "todo" -- should be removed when the code below is not comment | |
| z + k -- these are only experiements, usually explorations into the types of z and k |
This file contains hidden or 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
| toParserList :: Parser a -> Parser (List a) | |
| toParserList = bindParser (\i -> valueParser (i:.Nil)) | |
| concatParser :: Parser (List t) -> Parser (List t) -> Parser (List t) | |
| concatParser (P p1) (P p2) = | |
| P(\i -> withResultInput (\i2 a2 -> withResultInput (\i3 a3 -> Result i3 $ a2 ++ a3) $ p2 i2 ) $ p1 i) | |
| (~~~) :: | |
| Parser t | |
| -> Parser t |
This file contains hidden or 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
| sequenceParser :: | |
| List (Parser a) | |
| -> Parser (List a) | |
| sequenceParser ps = | |
| let | |
| in foldRight (~~<) (valueParser Nil) ps | |
| -- combinators for easily "appending" parsers |
This file contains hidden or 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
| ScalaJS.impls.example_WebAudio$AudioParam$class__$init$__Lexample_WebAudio$AudioParam__V = (function($this) { | |
| $this.value_$eq__Lscala_scalajs_js_Number__V(ScalaJS.modules.scala_Predef().$qmark$qmark$qmark__Lscala_Nothing()); | |
| $this.example$WebAudio$AudioParam$_setter_$defaultValue_$eq__Lscala_scalajs_js_Number__V(ScalaJS.modules.scala_Predef().$qmark$qmark$qmark__Lscala_Nothing()) | |
| }); | |
| ScalaJS.impls.example_WebAudio$GainNode$class__$init$__Lexample_WebAudio$GainNode__V = (function($this) { | |
| $this["example$WebAudio$GainNode$_setter_$gain"] = ScalaJS.modules.scala_Predef().$qmark$qmark$qmark__Lscala_Nothing() | |
| }); | |
| /** @constructor */ |