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,66 @@
load(
"@io_tweag_rules_haskell//haskell:haskell.bzl",
"haskell_library",
)
package(default_testonly = 1)
haskell_library(
name = "lib-a",
srcs = ["LibA.hs"],
deps = ["//tests/hackage:base"],
)
haskell_library(
name = "lib-b",
srcs = ["LibB.hs"],
visibility = ["//visibility:private"],
deps = [
":lib-a",
"//tests/hackage:base",
],
)
# Targets that must FAIL. These are tagged as manual so that
#
# $ bazel build //...
#
# does not fail.
haskell_library(
# Should fail because it doesn't specify "base" explicitly.
name = "lib-cFailure",
srcs = ["LibC.hs"],
tags = ["manual"],
deps = [":lib-b"],
)
haskell_library(
name = "lib-c",
srcs = ["LibC.hs"],
deps = [
":lib-b",
"//tests/hackage:base",
],
)
haskell_library(
# Should fail because it doesn't specify "lib-a" explicitly.
name = "lib-dFailure",
srcs = ["LibD.hs"],
tags = ["manual"],
deps = [
":lib-b",
"//tests/hackage:base",
],
)
haskell_library(
name = "lib-d",
srcs = ["LibD.hs"],
deps = [
":lib-a",
":lib-b",
"//tests/hackage:base",
],
)

View file

@ -0,0 +1,4 @@
module LibA (thingA) where
thingA :: Int
thingA = 5

View file

@ -0,0 +1,6 @@
module LibB (thingB) where
import LibA (thingA)
thingB :: Int
thingB = thingA + 1

View file

@ -0,0 +1,6 @@
module LibC (thingC) where
import LibB (thingB)
thingC :: Int
thingC = thingB * 2

View file

@ -0,0 +1,7 @@
module LibD (thingD) where
import LibA (thingA)
import LibB (thingB)
thingD :: Int
thingD = thingA + thingB