Skip to content

Instantly share code, notes, and snippets.

@RyanGlScott
RyanGlScott / happy
Last active Aug 29, 2015
Installing packages with special build-tools using cabal-install 1.20.0.3 on FreeBSD x86_64
View happy
[ryanscott@sabah-bsd] ~/.cabal% cabal install happy -j1 -v3
Searching for ghc in path.
Found ghc at /usr/local/bin/ghc
("/usr/local/bin/ghc",["--numeric-version"])
/usr/local/bin/ghc is version 7.8.3
looking for tool ghc-pkg near compiler in /usr/local/bin
found ghc-pkg in /usr/local/bin/ghc-pkg
("/usr/local/bin/ghc-pkg",["--version"])
/usr/local/bin/ghc-pkg is version 7.8.3
("/usr/local/bin/ghc",["--supported-languages"])
View Deep.hs
{-# LANGUAGE GADTs #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-|
Module: Deep
Copyright: (c) 2015 Ryan Scott
License: BSD3
Stability: Experimental
Portability: Template Haskell
View FreeTH.hs
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -ddump-splices #-}
module FreeTH where
import Control.Monad.Free
View ExampleGLFW-runghc-output.txt
Glasgow Haskell Compiler, Version 8.1.20160228, stage 2 booted by GHC version 7.10.3
Using binary package database: C:\Users\RyanGlScott\Software\ghc\inplace\lib\package.conf.d\package.cache
Using binary package database: C:\Users\RyanGlScott\AppData\Roaming\ghc\x86_64-mingw32-8.1.20160228\package.conf.d\package.cache
loading package database C:\Users\RyanGlScott\Software\ghc\inplace\lib\package.conf.d
loading package database C:\Users\RyanGlScott\AppData\Roaming\ghc\x86_64-mingw32-8.1.20160228\package.conf.d
wired-in package ghc-prim mapped to ghc-prim-0.5.0.0
wired-in package integer-gmp mapped to integer-gmp-1.0.0.1
wired-in package base mapped to base-4.9.0.0
wired-in package rts mapped to rts
wired-in package template-haskell mapped to template-haskell-2.11.0.0
View problem-libraries.md

Do each of the following libraries work in GHCi on Windows?

logfloat sdl2 GLFW-b
GHC 7.10.3 No (can't load .so/.DLL for: m.dll) No (can't load .so/.DLL for: mingw32.dll) Yes/No (Occasionally segfaults)
GHC 8.0.1-rc2 Yes No (duplicate definition of wmain) No (won't install, unknown symbol '__ms_vsnprintf')
GHC HEAD (Phab:D1805) Yes Yes Yes/No (Occasionally Segmentation fault/access violation in generated code)
@RyanGlScott
RyanGlScott / curl-1.22.log
Created May 24, 2016
cabal install curl --allow-newer
View curl-1.22.log
$ /opt/cabal/1.22/bin/cabal install curl --allow-newer -j1 -v3
Searching for ghc in path.
Found ghc at /opt/ghc/7.10.3/bin/ghc
("/opt/ghc/7.10.3/bin/ghc",["--numeric-version"])
/opt/ghc/7.10.3/bin/ghc is version 7.10.3
looking for tool ghc-pkg near compiler in /opt/ghc/7.10.3/bin
found ghc-pkg in /opt/ghc/7.10.3/bin/ghc-pkg
("/opt/ghc/7.10.3/bin/ghc-pkg",["--version"])
/opt/ghc/7.10.3/bin/ghc-pkg is version 7.10.3
("/opt/ghc/7.10.3/bin/ghc",["--supported-languages"])
View Gen_v1.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module Gen_v1 where
import GHC.Generics
data BigSum a =
C0 | C1 | C2 | C3 | C4 | C5 | C6 | C7 | C8 | C9
@RyanGlScott
RyanGlScott / Example.hs
Created Jun 8, 2016
Does bisum inline? Not sure.
View Example.hs
module Main (main) where
import Data.Bifoldable
import Data.Monoid ((<>))
data BiList a b = Nil | Cons a b (BiList a b)
deriving Show
instance Bifoldable BiList where
bifoldMap f g Nil = mempty
View Gen_v1.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module Gen_v1 where
import GHC.Generics
data Bigsum = C0 | C1 | C2 | C3
instance Generic Bigsum where
View NewRead.hs
import GHC.Read (list)
import Text.ParserCombinators.ReadPrec (ReadPrec, readPrec_to_S, readS_to_Prec)
import Text.Read (Read(..))
-- | Lifting of the 'Read' class to unary type constructors.
class Read1 f where
{-# MINIMAL liftReadsPrec | liftReadPrec #-}
-- | 'readsPrec' function for an application of the type constructor