Skip to content

Instantly share code, notes, and snippets.

@nomeata
Last active November 10, 2020 10:51
Show Gist options
  • Save nomeata/30450fc3fafa8265a513834b9a72e5e7 to your computer and use it in GitHub Desktop.
Save nomeata/30450fc3fafa8265a513834b9a72e5e7 to your computer and use it in GitHub Desktop.
issue914 repo
let
haskellNix = import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz") {};
pkgs = haskellNix.pkgs;
project = pkgs.pkgsCross.musl64.haskell-nix.cabalProject({
src = ./.;
compiler-nix-name = "ghc8102";
});
in
project.issue914.components.exes.issue914
{-# LANGUAGE TemplateHaskell #-}
module Foo where
import Language.Haskell.TH (Q,Exp)
import qualified Language.Haskell.TH.Syntax as TH
simpleVersion :: String -> Q Exp
simpleVersion version = [|$(TH.lift version)|]
cabal-version: >=1.10
name: issue914
version: 0.1.0.0
author: TheKK
maintainer: [email protected]
build-type: Simple
executable issue914
main-is: Main.hs
build-depends: base >=4
build-depends: template-haskell
default-language: Haskell2010
other-modules: Paths_issue914
other-modules: Foo
{-# LANGUAGE TemplateHaskell #-}
module Main where
import qualified Language.Haskell.TH.Syntax as TH
import Foo
main :: IO ()
-- main = print $( [|$(TH.lift "foo")|] )
main = print $(Foo.simpleVersion "foo")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment