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
void main() { | |
String? foo; | |
if (foo == null) { | |
print("it truly can be null"); | |
} else { | |
print("not null"); | |
} | |
} |
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
Future<int> onErrorTrickery() { | |
var f = Future<int>.error("original error"); | |
f.onError ((Object e, StackTrace st) { | |
print("onError callback running"); | |
throw "you cannot catch this error"; | |
}); | |
return f; | |
} | |
Future<void> secretError( ) async { |
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
// Did you know JavaScript has pure functions*? | |
// *: just add asterisks! | |
/** | |
* Describes a computation that requires `E` to produce an `A`. Has to be run | |
* to do anything. | |
* | |
* We could also do something like: | |
* `type Async<E,A> = Generator<void,Promise<A>,E>` | |
*/ |
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 Prelude | |
import Control.Monad.Eff.Console (log) | |
import Run (FProxy, Run, SProxy(SProxy), interpret, liftEffect, runBase) | |
data Speak a = Talk String a | Shout String a | |
derive instance functorSpeak :: Functor Speak |
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
### Keybase proof | |
I hereby claim: | |
* I am thoradam on github. | |
* I am thoradam (https://keybase.io/thoradam) on keybase. | |
* I have a public key whose fingerprint is EE55 B641 5693 7E88 EF24 65CA D294 D103 3923 9708 | |
To claim this, I am signing this object: |