Skip to content

Instantly share code, notes, and snippets.

[~]$ stack install cabal-install
hackage-security-0.5.2.2: configure
hackage-security-0.5.2.2: build
Progress: 1/2
-- While building package hackage-security-0.5.2.2 using:
/usr/home/alios/dot_files/.stack/setup-exe-cache/x86_64-freebsd/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0 build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: /usr/home/alios/dot_files/.stack/global-project/.stack-work/logs/hackage-security-0.5.2.2.log
Configuring hackage-security-0.5.2.2...
@alios
alios / fail.hs
Created November 6, 2011 06:57
type system problems with type families and classes
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
import Data.Bits
import Data.Word
class (Bits (T c)) => C c where
type T c :: *
@alios
alios / gist:1115357
Created July 30, 2011 09:11
ghc-7.0.4 linux i386
{-# LANGUAGE TemplateHaskell, FlexibleInstances #-}
import Test.QuickCheck
import Test.QuickCheck.All
instance (Bounded a, Enum a, Num a) => Eq (a -> a) where
f1 == f2 = and [f1 x == f2 x | x <- [minBound .. maxBound]]
t1, t2, t3 :: Int
{-# LANGUAGE TemplateHaskell #-}
import Test.QuickCheck.All
t1 x = x * x
t2 x = (x-1)*(x+1)+1
t3 x = (x-2)*(x+2)+4
prop_x1 x = t1 x == t2 x
prop_x2 x = t2 x == t3 x
@alios
alios / gist:1058863
Created July 1, 2011 16:19
problems with using persistant in a yesod sub site
{-# LANGUAGE MultiParamTypeClasses, TypeFamilies, GeneralizedNewtypeDeriving #-}
{-# LANGUAGE QuasiQuotes, TemplateHaskell, OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable, NoMonomorphismRestriction, FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
import Data.Text (Text)
import Language.Haskell.TH.Syntax hiding (lift)
import Yesod
@alios
alios / test.hs
Created January 3, 2011 15:52
problems with happstack templates on class methods
{-# LANGUAGE TemplateHaskell,
DeriveDataTypeable,
TypeFamilies,
MultiParamTypeClasses #-}
module Test where
import Data.Data
import Happstack.State