Continuation of Encoding Overlapping, Extensible Isomorphisms: encoding "open kinds" to better express some awkward type classes.
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
| -- Define acpi power logger | |
| acpi_power :: String -> [String] -> Logger | |
| acpi_power dev attr = | |
| io $ do | |
| attrOut <- mapM (\x -> liftIO $ readFile $ sysFsPath ++ x) attr | |
| return $ Just $ filter (/= '\n') (intercalate " " attrOut) | |
| where | |
| sysFsPath = "/sys/class/power_supply/" ++ dev ++ "/" | |
| file_reader :: String -> Logger |
- http://bitemyapp.com/posts/2017-09-23-please-stop-using-typed-holes.html
- http://vaibhavsagar.com/blog/2017/05/22/discovering-continuations/
- http://matthew.brecknell.net/post/hole-driven-haskell/
- https://www.youtube.com/watch?v=52VsgyexS8Q
- https://wiki.haskell.org/GHC/Typed_holes
- https://github.com/maddogdavis/holey
- https://ghc.haskell.org/trac/ghc/wiki/Holes
- https://www.shimweasel.com/2015/02/17/typed-holes-for-beginners
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
| #!/usr/bin/env python | |
| import time | |
| """ | |
| Utility Functions and decorators for internal use | |
| """ | |
| def timeit(method): | |
| def timed(*args, **kw): | |
| ts = time.time() |
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
| #include <assert.h> | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <stdlib.h> | |
| int ack_recursive(int m, int n) { | |
| if (m == 0) { | |
| return n + 1; | |
| } |
NewerOlder