feat(third_party/bazel): Check in rules_haskell from Tweag

This commit is contained in:
Vincent Ambo 2019-07-04 11:18:12 +01:00
parent 2eb1dc26e4
commit f723b8b878
479 changed files with 51484 additions and 0 deletions

View file

@ -0,0 +1,35 @@
load(
"@io_tweag_rules_haskell//haskell:haskell.bzl",
"haskell_library",
"haskell_test",
)
package(default_testonly = 1)
haskell_library(
name = "hsc-lib",
srcs = [
"Bar.hsc",
"Bar/Baz.hsc",
"Flags.hsc",
"Foo.hsc",
],
compiler_flags = [
"-DTHIS_IS_TRUE",
"-optP-DTHIS_TOO_IS_TRUE",
],
deps = ["//tests/hackage:base"],
)
haskell_test(
name = "hsc",
srcs = [
"BinHsc.hsc",
"Main.hs",
],
visibility = ["//visibility:public"],
deps = [
":hsc-lib",
"//tests/hackage:base",
],
)

View file

@ -0,0 +1,6 @@
module Bar (hscFiredBar) where
#ifndef _INTERNAL_HSC_DO_NOT_DEFINE_ME
hscFiredBar :: String
hscFiredBar = "hscFiredBar"
#endif

View file

@ -0,0 +1,6 @@
module Bar.Baz (hscFiredBaz) where
#ifndef _INTERNAL_HSC_DO_NOT_DEFINE_ME
hscFiredBaz :: String
hscFiredBaz = "hscFiredBaz"
#endif

View file

@ -0,0 +1 @@
module BinHsc () where

View file

@ -0,0 +1,8 @@
module Flags (hscFlags) where
#ifdef THIS_IS_TRUE
#ifdef THIS_TOO_IS_TRUE
hscFlags :: String
hscFlags = "hscFlags"
#endif
#endif

View file

@ -0,0 +1,8 @@
module Foo (hscFiredFoo) where
#if __GLASGOW_HASKELL__ >= 700
#ifndef _INTERNAL_HSC_DO_NOT_DEFINE_ME
hscFiredFoo :: String
hscFiredFoo = "hscFiredFoo"
#endif
#endif

View file

@ -0,0 +1,10 @@
module Main (main) where
import BinHsc ()
import Foo (hscFiredFoo)
import Bar (hscFiredBar)
import Bar.Baz (hscFiredBaz)
import Flags (hscFlags)
main :: IO ()
main = putStrLn (hscFiredFoo ++ hscFiredBar ++ hscFiredBaz ++ hscFlags)