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
./stack install hprotoc | |
~/.local/bin/hprotoc ./gtfs-realtime.proto | |
The proto file needed to be hacked in 4 ways: | |
* comment out/delete the 'syntax = "proto2";' line. | |
* insert line breaks before end curly braces: | |
extensions 1000 to 1999; | |
} |
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 ScopedTypeVariables #-} | |
class HasMode a where | |
mode :: Proxy a -> Mode | |
instance HasMode 'BrowseMail where | |
mode _ = BrowseMail | |
-- | instantiate this class to specify a valid mode transition | |
class ModeTransition a b where |
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 PolyKinds #-} | |
{-# LANGUAGE DataKinds #-} | |
module Poly where | |
data Mode = Mode1 | Mode2 | |
data Action ctx a = Action | |
-- | Coerce the phantoms (poly-kinded) |