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
| Bus App | |
| idle | |
| DOOR_OPEN -> loading | |
| loading | |
| DOOR_CLOSE -> stopped | |
| #要放 cond 因為 close 不代表有放入 cd | |
| loadError | |
| # | |
| stopped | |
| ON_EJECT -> idle |
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
| Bus App | |
| display | |
| RELOAD -> loading | |
| loading | |
| LOAD_OK -> display | |
| LOAD_FAIL -> error | |
| error | |
| RELOAD -> loading | |
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
| Gallery App | |
| gallery | |
| SEARCH -> loading | |
| SELECT_PHOTO -> photo | |
| RELOAD -> gallery | |
| loading | |
| CANCEL -> gallery | |
| SEARCH_FAILED -> error | |
| SEARCH_SUCCESS -> gallery | |
| error |
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
| import io from 'socket.io-client' | |
| const A = require('automerge') | |
| const foo = bar => { | |
| bar.map( b => b.title ) | |
| } | |
| startConnection() { | |
| this.socket = io('http://localhost:5000') |
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
| -- f (x:xs) = case x `elem` xs of | |
| -- True -> f xs | |
| -- False -> x | |
| f s = f' $ map toLower s | |
| where | |
| f' (x:xs) = | |
| case x `elem` xs of | |
| True -> f' xs | |
| False -> x |
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
| module Main where | |
| import Control.Monad.State | |
| import System.Directory | |
| import System.Exit | |
| import System.FilePath | |
| import Data.Time | |
| data File = File | |
| { name :: FilePath |
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
| {- | |
| Functionality: | |
| - Read all folders and sub-folders with structure like below | |
| - store all folder and file info in State monad, | |
| - at the end of the loop, print it. | |
| ├── aaa | |
| │ ├── b | |
| │ │ ├── b1 | |
| │ │ │ ├── b1-1 |
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
| module Bar () where | |
| import Data.Maybe | |
| import Control.Monad.State | |
| import qualified Data.Map as M | |
| data Item = Item { | |
| sId :: String, | |
| pId :: String, | |
| value :: [Char], | |
| children :: [String] |
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 Item = Item { | |
| sId :: String, | |
| pId :: String, | |
| value :: [Char], | |
| children :: [Item] | |
| } deriving (Show) | |
| list :: [Item] | |
| list = [ | |
| Item { sId="1", pId="0", value="1", children=[] }, |
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 Item = Item { | |
| sId :: String, | |
| pId :: String, | |
| value :: [Char], | |
| children :: [String] | |
| } deriving (Show) | |
| list :: [Item] | |
| list = [ | |
| Item { sId="1", pId="0", value="1", children=[] }, |