Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ build.ninja

# Cabal-generated files
/dist-newstyle/
*.agdai
117 changes: 117 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
description = "Description for the project";

inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
agda2hs.url = "github:stites/agda2hs/acorn";
nixpkgs.follows = "agda2hs/nixpkgs";
};

outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, ... }: rec {
packages = let
agda2hs-lib = inputs'.agda2hs.packages.agda2hs-lib;
agda-packages = [
agda2hs-lib
pkgs.agdaPackages.cubical
pkgs.agdaPackages.standard-library
];
agda2hs = inputs.agda2hs.lib.${system}.withPackages agda-packages;
agda-with-packages = pkgs.agda.withPackages (ps: agda-packages);
in {
inherit agda2hs agda-with-packages;
};
devShells.default = with packages; pkgs.haskellPackages.shellFor {
packages = p: [];
buildInputs = with pkgs.haskellPackages; [
self'.packages.agda2hs
self'.packages.agda-with-packages
cabal-install
cabal2nix
haskell-language-server
];
};
};
};
}
2 changes: 1 addition & 1 deletion src/Implementation/Frac.agda
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ open import Operator.Pow
-- Since we don't use classes below SemiRing to maintain
-- Haskell compatibility (by avoiding to give operators as parameters);
-- the constraint here is SemiRing a.
record Frac (a : Set) {{semiRing : SemiRing a}} : Set where
record Frac (a : Set) {{@0 semiRing : SemiRing a}} : Set where
constructor MkFrac
field
num den : a
Expand Down
3 changes: 2 additions & 1 deletion src/Operator/Pow.agda
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ open import Algebra.Setoid
open import Algebra.SemiRing

-- Actually, the exponent need not be a Nat; it can also be from a "similar" structure.
record Pow (a : Set) {{semiringa : SemiRing a}} (b : Set) {{semiringb : SemiRing b}}
-- erase semi-ring constraints: https://github.com/agda/agda2hs/issues/366#issuecomment-2385064760
record Pow (a : Set) {{@0 semiringa : SemiRing a}} (b : Set) {{@0 semiringb : SemiRing b}}
: Set₁ where
infixr 8 _^_
field
Expand Down
2 changes: 1 addition & 1 deletion src/RealTheory/Completion.agda
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ open import RealTheory.Interval
-- This will be a newtype in Haskell.
-- Sometimes, the range of a function might not be a prelength space;
-- hence we allow this.
record C (a : Set) {{metricSpace : MetricSpace a}}
record C (a : Set) {{@0 metricSpace : MetricSpace a}}
: Set where
constructor MkC
field
Expand Down
4 changes: 2 additions & 2 deletions src/RealTheory/Continuity.agda
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ UcFunOn {a} subset b = Σ' (a -> b) (UniformlyContinuousOn subset)
-}


record UniformlyContinuous {a b : Set} {{msa : MetricSpace a}} {{msb : MetricSpace b}}
record UniformlyContinuous {a b : Set} {{@0 msa : MetricSpace a}} {{@0 msb : MetricSpace b}}
(@0 f : a -> b) : Set where
constructor WrapMod
field
Expand All @@ -47,7 +47,7 @@ open UniformlyContinuous public

-- What if we used instances for that?

UcFun : (a b : Set) {{msa : MetricSpace a}} {{msb : MetricSpace b}}
UcFun : (a b : Set) {{@0 msa : MetricSpace a}} {{@0 msb : MetricSpace b}}
-> Set
UcFun a b = Σ' (a -> b) UniformlyContinuous
{-# COMPILE AGDA2HS UcFun #-}