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
(* a solution to Exercise 9.10 of "Purely Functional Data Structures (PFDS)" *) | |
module type ITEM = | |
sig | |
type t | |
val print : t -> unit | |
end | |
module Int : (ITEM with type t = int) = | |
struct |
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
$ ghci | |
GHCi, version 7.4.1: http://www.haskell.org/ghc/ :? for help | |
Loading package ghc-prim ... linking ... done. | |
Loading package integer-gmp ... linking ... done. | |
Loading package base ... linking ... done. | |
Prelude> import Data.Binary.Strict.BitGet | |
Prelude Data.Binary.Strict.BitGet> import Data.ByteString | |
Prelude Data.Binary.Strict.BitGet Data.ByteString> let a = pack [0x80,0x00] | |
Loading package bytestring-0.9.2.1 ... linking ... done. | |
Prelude Data.Binary.Strict.BitGet Data.ByteString> let r = runBitGet a $ getBit |
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
diff -Naru hsc2hs-ghc-7.4.1/utils/hsc2hs/Common.hs hsc2hs-ghc-7.4.1-fixed/utils/hsc2hs/Common.hs | |
--- hsc2hs-ghc-7.4.1/utils/hsc2hs/Common.hs 2012-02-02 03:10:32.000000000 +0900 | |
+++ hsc2hs-ghc-7.4.1-fixed/utils/hsc2hs/Common.hs 2012-08-20 12:30:18.350942900 +0900 | |
@@ -24,7 +24,11 @@ | |
splitName :: String -> (String, String) | |
splitName name = | |
+#if defined(mingw32_HOST_OS) | |
+ case break (== '\\') name of | |
+#else |
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 type ITEM = | |
sig | |
type t | |
val print : t -> unit | |
end | |
module type ORDERED = | |
sig | |
include ITEM |
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
$ cab install ghc-mod | |
Resolving dependencies... | |
Downloading ghc-mod-1.10.8... | |
Configuring ghc-mod-1.10.8... | |
Preprocessing executables for ghc-mod-1.10.8... | |
Building ghc-mod-1.10.8... | |
[ 1 of 16] Compiling GHCChoice ( GHCChoice.hs, dist\build\ghc-mod\ghc-mod-tmp\GHCChoice.o ) | |
[ 2 of 16] Compiling Gap ( Gap.hs, dist\build\ghc-mod\ghc-mod-tmp\Gap.o ) | |
[ 3 of 16] Compiling ErrMsg ( ErrMsg.hs, dist\build\ghc-mod\ghc-mod-tmp\ErrMsg.o ) | |
[ 4 of 16] Compiling Types ( Types.hs, dist\build\ghc-mod\ghc-mod-tmp\Types.o ) |
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
#!/bin/sh | |
exec "$0"/../ghc-mod ${1+"$@"} | dos2unix |
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 ExplicitMin (ExplicitMin) where | |
import Heap | |
data (Heap h) => ExplicitMin h a = E | |
| NE a (h a) | |
deriving (Show) | |
instance (Heap h) => Heap (ExplicitMin h) where | |
empty = E |
NewerOlder