Skip to content

Instantly share code, notes, and snippets.

View RyanGlScott's full-sized avatar

Ryan Scott RyanGlScott

View GitHub Profile
@RyanGlScott
RyanGlScott / happy
Last active August 29, 2015 14:04
Installing packages with special build-tools using cabal-install 1.20.0.3 on FreeBSD x86_64
[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"])
@RyanGlScott
RyanGlScott / Deep.hs
Created July 28, 2015 18:56
FromJSONWith
{-# LANGUAGE GADTs #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-|
Module: Deep
Copyright: (c) 2015 Ryan Scott
License: BSD3
Stability: Experimental
Portability: Template Haskell
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -ddump-splices #-}
module FreeTH where
import Control.Monad.Free
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

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 13:08
cabal install curl --allow-newer
$ /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"])
{-# 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 June 8, 2016 13:30
Does bisum inline? Not sure.
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
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module Gen_v1 where
import GHC.Generics
data Bigsum = C0 | C1 | C2 | C3
instance Generic Bigsum where
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