-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new rule
haskell_prebuilt_library
.
This rule forwards a prebuilt dependency, so that it may be specified directly in `deps` rather than `prebuilt_dependencies`. This gives progress on #75. Similarly, it simplifies the use of Hazel, which can now generate repositories for the prebuilt dependencies just like for regular packages.
- Loading branch information
Showing
6 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package(default_testonly = 1) | ||
|
||
load( | ||
"@io_tweag_rules_haskell//haskell:haskell.bzl", | ||
"haskell_library", | ||
"haskell_prebuilt_library", | ||
"haskell_test", | ||
) | ||
|
||
haskell_prebuilt_library( | ||
name = "bytestring", | ||
) | ||
|
||
haskell_prebuilt_library( | ||
name = "text_pkg", | ||
package = "text", | ||
) | ||
|
||
haskell_library( | ||
name = "Lib", | ||
srcs = ["Lib.hs"], | ||
prebuilt_dependencies = ["base"], | ||
deps = [":bytestring"], | ||
) | ||
|
||
haskell_test( | ||
name = "binary", | ||
srcs = ["Bin.hs"], | ||
main_file = "Bin.hs", | ||
prebuilt_dependencies = ["base"], | ||
deps = [ | ||
":text_pkg", | ||
":Lib", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module Main (main) where | ||
|
||
import qualified Data.Text.IO as T | ||
import qualified Data.Text.Encoding as E | ||
|
||
import Lib (message) | ||
|
||
main = T.putStrLn $ E.decodeUtf8 message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Lib (message) where | ||
|
||
import qualified Data.ByteString.Char8 as B | ||
|
||
message = B.pack "hello, world" |