View gist:990126af5d60f77f51b8d4468060c922
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 Data.Generic.Rep (class Generic, Argument, Constructor, Product) | |
import Effect (Effect) | |
import Effect.Class.Console as Console | |
import Effect.Uncurried (EffectFn1, EffectFn2, EffectFn3, runEffectFn1, runEffectFn2, runEffectFn3) | |
import Prelude (Unit, bind, discard, (>>=)) | |
import Type.Data.Peano.Nat (class IsNat, NProxy, Succ, Z, d0, reflectNat, kind Nat) | |
-- Any product data type with a Generic instance can be made mutable! |
View gist:ead4cfdf3c4a4e6334d6c37dd45ad61f
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 SIMPLE-SYNTAX | |
endmodule | |
module SIMPLE | |
imports BOOL | |
imports INT | |
syntax S ::= "mul(" S "," S ")" |
View gist:c4af06070a794396567681fad954aa87
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 SIMPLE-SYNTAX | |
endmodule | |
module SIMPLE | |
imports BOOL | |
imports INT | |
syntax S ::= "mul(" S "," S ")" |
View gist:31fadb0fb4078f763096879e8c81fe9f
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 SIMPLE-SYNTAX | |
endmodule | |
module SIMPLE | |
imports BOOL | |
imports INT | |
syntax Bitfield ::= Bitfield Bit |
View gist:40f42da6ab544950bab147fbbd182fba
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 SIMPLE-SYNTAX | |
endmodule | |
module SIMPLE | |
imports BOOL | |
imports INT | |
syntax Bitfield ::= Bitfield Bit |
View gist:42c142add3b0c37e08d8118c6e2b577f
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
// simple.k | |
module SIMPLE-SYNTAX | |
endmodule | |
module SIMPLE | |
imports BOOL | |
imports INT |
View gist:436408b23a7d2de92bfb59602423cd75
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 FRIST-SYNTAX | |
imports BOOL | |
syntax Expr ::= Expr "+" Expr [left, strict] | |
| "(" Expr ")" [bracket] | |
| Ident | |
syntax Ident ::= "x" | "y" | "z" |
View gist:066defb6e76b4d7f167fb2f59bc5800a
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 FRIST-SYNTAX | |
syntax Expr ::= Expr "+" Expr [left, strict] | |
| "(" Expr ")" [bracket] | |
| Ident | |
syntax Ident ::= "x" | "y" | "z" | |
endmodule |
View gist:2631a350803027471698f60d61b464bc
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
if (interrupt === null) { | |
switch (status) { | |
case SUSPEND: return util.stateSuspended; | |
case COMPLETED: return util.stateCompleted; | |
default: return util.stateRunning; | |
} | |
} | |
else { | |
switch (status) { | |
case COMPLETED: return util.stateKilled; |
View x.purs
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
class (LeftModule v a, RightModule v a) ⇐ Bimodule v a | |
newtype Pixels = Pixels (Additive Number) | |
derive newtype instance bimodulePixels ∷ Bimodule Pixels Number | |
--- | |
Cannot derive the type class instance |
NewerOlder