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
| {-# LANGUAGE | |
| FlexibleContexts | |
| , FlexibleInstances | |
| , MultiParamTypeClasses | |
| , TypeSynonymInstances | |
| #-} | |
| module ToStringy (ToStringy (..), fromStringy) where | |
| import Data.String | |
| import qualified Data.ByteString as SB |
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
| {-# LANGUAGE RankNTypes, TypeFamilies, ConstraintKinds #-} | |
| import Data.String | |
| import Data.String.ToString | |
| import Text.XML.HXT.Arrow.Pickle | |
| import GHC.Exts | |
| import qualified Data.Map.Strict as SM | |
| f :: (C map key, C map String, XmlPickler (map String value), IsString key, ToString key) | |
| => (forall k k'. C map k => (k -> k') -> map k value -> map k' value) |
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
| warming up | |
| estimating clock resolution... | |
| mean is 941.9046 ns (640001 iterations) | |
| found 1045200 outliers among 639999 samples (163.3%) | |
| 501011 (78.3%) low severe | |
| 544189 (85.0%) high severe | |
| estimating cost of a clock call... | |
| mean is 52.69083 ns (7 iterations) | |
| benchmarking positional/decode/presidents/without conversion |
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
| -- $ ghc -ddump-simpl -dsuppress-all Fib.hs -fforce-recomp -O2 | |
| [1 of 1] Compiling Fib ( Fib.hs, Fib.o ) | |
| ==================== Tidy Core ==================== | |
| Result size of Tidy Core = {terms: 52, types: 59, coercions: 0} | |
| fibs3 | |
| fibs3 = __integer 1 | |
| fibs4 |
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
| (add-hook 'haskell-mode-hook | |
| (lambda () (add-hook 'before-save-hook 'kill-warnings-buffer nil 'make-it-local))) | |
| (defun kill-warnings-buffer () | |
| (when (get-buffer "*Warnings*") | |
| (kill-buffer "*Warnings*"))) |
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
| ;; Projectile | |
| (progn | |
| (require 'projectile) | |
| (projectile-global-mode) | |
| (setq projectile-indexing-method 'alien) | |
| (setq projectile-enable-caching t)) | |
| ;; Relax the GC | |
| (setq gc-cons-threshold 20000000) |
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 Static = X | Y | |
| resource :: Resource WithA WithB Ident Void Static | |
| resource = mkResourceReader | |
| { R.name = "foo" | |
| , R.schema = noListing $ named | |
| [ ("id" , singleRead ById ) | |
| , ( "x" , static X ) | |
| , ( "y" , static Y ) | |
| ] |
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
| // x :: Either (Either a b) c -> Either a (Either b c) | |
| // x = either (either Left (Right . Left)) (Right . Right) | |
| interface Either<A,B> { | |
| left? : A; | |
| right? : B; | |
| } | |
| class Fns | |
| { |
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
| #!/bin/bash | |
| cabal configure && cabal build && cabal haddock --hyperlink-source --html-location='http://localhost:8080/package/$pkg/docs' --contents-location='http://localhost:8080/package/$pkg' | |
| S=$? | |
| if [ "${S}" -eq "0" ]; then | |
| cd "dist/doc/html" | |
| DDIR="${1}-${2}-docs" | |
| cp -r "${1}" "${DDIR}" && tar -c -v -z --format=ustar -f "${DDIR}.tar.gz" "${DDIR}" | |
| CS=$? | |
| if [ "${CS}" -eq "0" ]; then | |
| echo "Uploading to Hackage…" |
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
| example/Example.hs:1:1: Splicing declarations | |
| mkId ''Id | |
| ======> | |
| example/Example.hs:25:1-9 | |
| unsafeId :: UUID -> Id | |
| unsafeId = Id | |
| unsafeId' :: UUID -> Maybe Id | |
| unsafeId' = (.) Just Id | |
| instance FromField Id where | |
| fromField = fromFieldAux unsafeId' |
OlderNewer