Haskell : Create Hello World.
This commit is contained in:
parent
0488272633
commit
40926bf7e0
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
.NixRoot*
|
||||
build/
|
||||
|
|
3
haskell/Hello.hs
Normal file
3
haskell/Hello.hs
Normal file
|
@ -0,0 +1,3 @@
|
|||
main = do
|
||||
putStrLn "Hello, everybody!"
|
||||
putStrLn ("Please look at my favorite odd numbers: " ++ show (filter odd [10..20]))
|
19
haskell/Makefile
Normal file
19
haskell/Makefile
Normal file
|
@ -0,0 +1,19 @@
|
|||
main = "Hello.hs"
|
||||
build = "build"
|
||||
elf = "$(build)/elf"
|
||||
|
||||
.PHONY: all
|
||||
all: clean build run
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@rm -rf $(build)
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
@mkdir $(build) &> /dev/null; \
|
||||
ghc -outputdir $(build) -o $(elf) $(main)
|
||||
|
||||
.PHONY: run
|
||||
run:
|
||||
@./$(elf)
|
27
haskell/flake.lock
Normal file
27
haskell/flake.lock
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1709961763,
|
||||
"narHash": "sha256-6H95HGJHhEZtyYA3rIQpvamMKAGoa8Yh2rFV29QnuGw=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "3030f185ba6a4bf4f18b87f345f104e6a6961f34",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
Loading…
Reference in a new issue