Skip to content

Commit

Permalink
Merge pull request #167 from input-output-hk/bwbush/pc2
Browse files Browse the repository at this point in the history
Implemented `chainWeight` in Agda and reorganized packages and build
  • Loading branch information
bwbush authored Jul 3, 2024
2 parents bd2e07e + 88b7379 commit 520eba1
Show file tree
Hide file tree
Showing 28 changed files with 120 additions and 320 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ jobs:
trusted-public-keys = ${{ env.TRUSTED_PUBLIC_KEYS }}
substituters = ${{ env.SUBSTITUTERS }}
experimental-features = nix-command flakes
- name: 🔬 Test with `peras-hs-test`
run: |
nix run .#peras-hs-test
- name: 🔬 Test with `peras-simulation-test`
run: |
nix run .#peras-simulation-test
Expand Down
19 changes: 6 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
AGDAFILES := $(shell find src -name *.agda -exec grep -l AGDA2HS {} \;)
LAGDAFILES := $(shell find src -name *.lagda.md -exec grep -l AGDA2HS {} \;)
SIMAGDAFILES := $(shell find sim_src -name *.agda -exec grep -l AGDA2HS {} \;)
HSDIR=peras-hs
HSDIR=peras-simulation
HSFILES := $(patsubst %.agda,$(HSDIR)/%.hs,$(AGDAFILES))
LHSFILES := $(patsubst %.lagda.md,$(HSDIR)/%.hs,$(LAGDAFILES))
SIMHSFILES := $(patsubst sim_src/%.agda,peras-simulation/src/%.hs,$(SIMAGDAFILES))
Expand All @@ -18,29 +18,22 @@ $(info $(LHSFILES))
.PHONY: typecheck

all: typecheck
cabal update
cabal build all

typecheck: $(HSFILES) $(LHSFILES) $(SIMHSFILES)
@rm -f $(BADSIMHSFILES)

# From https://stackoverflow.com/questions/34621364/makefile-compile-o-from-c-files
$(HSDIR)/%.hs: %.agda
@$(AGDA) --local-interfaces --library-file=$(AGDA_LIBS) $^
@$(AGDA2HS) --local-interfaces --library-file=$(AGDA_LIBS) --compile-dir=$(HSDIR)/src --config $(AGDA2HS_CONFIG) $^
@$(AGDA) --compile --ghc-dont-call-ghc --no-main --local-interfaces --library-file=$(AGDA_LIBS) --compile-dir=$(HSDIR)/src $^

$(HSDIR)/%.hs: %.lagda.md
@$(AGDA) --local-interfaces --library-file=$(AGDA_LIBS) $^
@$(AGDA2HS) --local-interfaces --library-file=$(AGDA_LIBS) --compile-dir=$(HSDIR)/src --config $(AGDA2HS_CONFIG) $^
@$(AGDA) --compile --ghc-dont-call-ghc --no-main --local-interfaces --library-file=$(AGDA_LIBS) --compile-dir=$(HSDIR)/src $^

peras-simulation/src/%.hs : sim_src/%.agda
@$(AGDA2HS) --local-interfaces --library-file=$(AGDA_LIBS) --compile-dir=peras-simulation/src $^
.PHONY : clean

.PHONY : clean veryclean
clean:
@echo "Removing .agdai files"
@find src -name \*.agdai -delete;

veryclean: clean
@echo "Removing generated.hs files"
@rm $(HSFILES) $(LHSFILES)
@echo "Removing generated .hs files"
@rm -f $(HSFILES) $(LHSFILES)
1 change: 0 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ index-state:
, cardano-haskell-packages 2024-05-29T10:15:00Z

packages:
peras-hs
peras-simulation
peras-markov
peras-server
Expand Down
2 changes: 1 addition & 1 deletion nix/agda-project.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pkgs.haskell-nix.hackage-project {
name = "Agda";

version = "2.6.4.1";
version = "2.6.4.3";

compiler-nix-name = "ghc96";

Expand Down
176 changes: 0 additions & 176 deletions peras-hs/LICENSE

This file was deleted.

1 change: 0 additions & 1 deletion peras-hs/ReadMe.md

This file was deleted.

69 changes: 0 additions & 69 deletions peras-hs/peras-hs.cabal

This file was deleted.

1 change: 0 additions & 1 deletion peras-hs/test/Main.hs

This file was deleted.

File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 520eba1

Please sign in to comment.