Skip to content

Instantly share code, notes, and snippets.

View christiaanb's full-sized avatar

Christiaan Baaij christiaanb

  • QBayLogic
  • Enschede, The Netherlands
View GitHub Profile
@christiaanb
christiaanb / EDSL.hs
Created April 11, 2012 16:30
EDSL of lambda-calculus + mutable references
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TupleSections #-}
module EDSL where
import Data.IORef
@christiaanb
christiaanb / gist:3776214
Created September 24, 2012 14:28
fp.bat
@ECHO OFF
IF NOT EXIST P:\haskell\ghc\package.cache (
goto :install-fp
) ELSE (
goto :install-fp-end
)
:install-fp
md P:\haskell
@christiaanb
christiaanb / Vector.hs
Created September 25, 2012 13:45
Type-Indexed Vectors with type-level naturals
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module CLaSH.Sized.Vector where
import GHC.TypeLits
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -Wall #-}
-- {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- TEMP
-- {-# OPTIONS_GHC -fno-warn-unused-binds #-} -- TEMP
----------------------------------------------------------------------
-- |
-- Module : PluginImportId.Plugin
-- Copyright : (c) 2013 Tabula, Inc.
diff --git rules/relative-dynlib-references.mk rules/relative-dynlib-references.mk
index 03dabc1..ef85f64 100644
--- rules/relative-dynlib-references.mk
+++ rules/relative-dynlib-references.mk
@@ -25,6 +25,9 @@ ifneq "$3" "0"
ifneq "$$($1_$2_TRANSITIVE_DEP_NAMES)" ""
install_name_tool $$(foreach d,$$($1_$2_TRANSITIVE_DEP_NAMES), -change $$(TOP)/$$($$($$d_INSTALL_INFO)_dyn_LIB) @loader_path/../$$d-$$($$($$d_INSTALL_INFO)_VERSION)/$$($$($$d_INSTALL_INFO)_dyn_LIB_NAME)) $$@
endif
+ifneq "$$($1_$2_dyn_LIB_NAME)" ""
+ install_name_tool -id @loader_path/../$$($1_PACKAGE)-$$($1_$2_VERSION)/$$($1_$2_dyn_LIB_NAME) $$@
diff --git src/Haddock.hs src/Haddock.hs
index a7ac5ba..cecd7f5 100644
--- src/Haddock.hs
+++ src/Haddock.hs
@@ -113,6 +113,11 @@ handleGhcExceptions =
case e of
PhaseFailed _ code -> exitWith code
_ -> do
+ flags <- saveStaticFlagGlobals
+ unless (fst flags) $ do
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 44a6fa5..337778e 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1900,6 +1900,13 @@ linkBinary' staticLink dflags o_files dep_packages = do
then ["-Wl,-read_only_relocs,suppress"]
else [])
+ ++ (if platformOS platform == OSDarwin &&
+ not staticLink &&
diff --git a/src/Haddock.hs b/src/Haddock.hs
index a7ac5ba..2cd220c 100644
--- a/src/Haddock.hs
+++ b/src/Haddock.hs
@@ -113,6 +113,11 @@ handleGhcExceptions =
case e of
PhaseFailed _ code -> exitWith code
_ -> do
+ flags <- saveStaticFlagGlobals
+ unless (fst flags) $ do
@christiaanb
christiaanb / typegenerics.vhdl
Created November 20, 2013 14:05
Type and Function generics
library ieee;
use ieee.std_logic_1164.all;
entity incrementer is
generic (type data_type;
function increment (x: data_type) return data_type);
port (I : in data_type;
O : out data_type;
inc : in std_logic);
end;
diff --git a/compiler/typecheck/TcInteract.lhs b/compiler/typecheck/TcInteract.lhs
index 377cd2d..a742f96 100644
--- a/compiler/typecheck/TcInteract.lhs
+++ b/compiler/typecheck/TcInteract.lhs
@@ -31,6 +31,8 @@ import FamInstEnv ( FamInstEnvs, instNewTyConTF_maybe )
import TcEvidence
import Outputable
+import TcTypeNats ( evBySOP, sopRelevantTyCon, sopToProp, sopToExpr, solveSOP )
+