From nad at cse.gu.se Mon Nov 2 12:44:35 2020 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Mon, 2 Nov 2020 12:44:35 +0100 Subject: [Agda-dev] A tutorial on inference in Agda In-Reply-To: References: Message-ID: <5d5aafc5-0e90-540c-23c6-9671a5456a06@cse.gu.se> On 2020-10-26 03:03, Roman wrote: > Does Agda support generating an HTML page (with all the coloring) from > an Agda file when that file contains warnings, unresolved metas etc? I tried the following code: {-# OPTIONS --allow-unsolved-metas #-} A : Set A = _ A = _ The code is not highlighted in quite the same way as in the Emacs mode (at least in the browser that I tried): the final underscore gets the dead code highlighting, rather than the one for unsolved meta-variables. I could fix this by reordering some lines in Agda.css, but I don't know if the CSS standard requires browsers to respect the ordering of lines in this way. > And is there a flag to make Agda accept ill-typed code, show a warning > and proceed with type checking? No (see https://github.com/agda/agda/issues/2114). -- /NAD From ulfn at chalmers.se Mon Nov 2 16:03:55 2020 From: ulfn at chalmers.se (Ulf Norell) Date: Mon, 2 Nov 2020 16:03:55 +0100 Subject: [Agda-dev] Mysteries of the GHC recompilation checker In-Reply-To: <3d12f16b-94e9-9d72-a8a1-3c3258b81bf2@chalmers.se> References: <3d12f16b-94e9-9d72-a8a1-3c3258b81bf2@chalmers.se> Message-ID: Yes, happens for me too. Same OS/ghc version. Googling turns up this commit https://gitlab.haskell.org/ghc/ghc/-/commit/bd5ee887a46a4601b08d4e3a8316262a262eb225 There's a `traceHiDiffs` call that actually shows (one of) the missing dependencies. Compiling with -ddump-hi-diffs gives (among a bazillion lines of output): ... missing old home dependency ?Agda.Syntax.Abstract.Name? [ 94 of 392] Compiling Agda.Compiler.Builtin[boot] ( src/full/Agda/Compiler/Builtin.hs-boot, dist-2.6.2-ghc-8.10.2/build/Agda/Compiler/Builtin.o-boot, dist-2.6.2-ghc-8.10.2/build/Agda/Compiler/Builtin.dy n_o ) [missing old dependency] ... missing old home dependency ?Agda.TypeChecking.Monad.Debug? [190 of 392] Compiling Agda.TypeChecking.Pretty.Call[boot] ( src/full/Agda/TypeChecking/Pretty/Call.hs-boot, dist-2.6.2-ghc-8.10.2/build/Agda/TypeChecking/Pretty/Call.o-boot, dist-2.6.2-ghc-8.10.2/build/ Agda/TypeChecking/Pretty/Call.dyn_o ) [missing old dependency] ... missing old home dependency ?Agda.Interaction.Highlighting.Precise? [201 of 392] Compiling Agda.Interaction.Base ( src/full/Agda/Interaction/Base.hs, dist-2.6.2-ghc-8.10.2/build/Agda/Interaction/Base.o, dist-2.6.2-ghc-8.10.2/build/Agda/Interaction/Base.dyn_o ) [missing o ld dependency] ... missing old home dependency ?Agda.Syntax.Internal.Defs? [350 of 392] Compiling Agda.TypeChecking.Rules.Builtin ( src/full/Agda/TypeChecking/Rules/Builtin.hs, dist-2.6.2-ghc-8.10.2/build/Agda/TypeChecking/Rules/Builtin.o, dist-2.6.2-ghc-8.10.2/build/Agda/TypeChecking/Rules/Builtin.dyn_o ) [missing old dependency] ... Not sure what it all means though... / Ulf On Wed, Oct 28, 2020 at 10:56 AM Andreas Abel wrote: > Do you also see the "missing old dependency" for exactly two files when > you recompile Agda? (Mac, GHC 8.10.2) > > [201 of 386] Compiling Agda.Interaction.Base ( > src/full/Agda/Interaction/Base.hs, > dist-2.6.2-ghc-8.10.2/build/Agda/Interaction/Base.o, > dist-2.6.2-ghc-8.10.2/build/Agda/Interaction/Base.dyn_o ) [missing old > dependency] > > [349 of 386] Compiling Agda.TypeChecking.Rules.Builtin ( > src/full/Agda/TypeChecking/Rules/Builtin.hs, > dist-2.6.2-ghc-8.10.2/build/Agda/TypeChecking/Rules/Builtin.o, > dist-2.6.2-ghc-8.10.2/build/Agda/TypeChecking/Rules/Builtin.dyn_o ) > [missing old dependency] > > Agda.Interaction.Base and Agda.TypeChecking.Rules.Builtin are always > recompiled on my machine. Luckily, this is not infective, files > depending on these are not recompiled. > > Any explanation for this phenomenon? > > -- > Andreas Abel <>< Du bist der geliebte Mensch. > > Department of Computer Science and Engineering > Chalmers and Gothenburg University, Sweden > > andreas.abel at gu.se > http://www.cse.chalmers.se/~abela/ > _______________________________________________ > Agda-dev mailing list > Agda-dev at lists.chalmers.se > https://lists.chalmers.se/mailman/listinfo/agda-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From effectfully at gmail.com Mon Nov 2 23:21:38 2020 From: effectfully at gmail.com (Roman) Date: Tue, 3 Nov 2020 01:21:38 +0300 Subject: [Agda-dev] A tutorial on inference in Agda In-Reply-To: <5d5aafc5-0e90-540c-23c6-9671a5456a06@cse.gu.se> References: <5d5aafc5-0e90-540c-23c6-9671a5456a06@cse.gu.se> Message-ID: Nils, I tried using the pragma and calling `agda --html UnificationInAgda.lagda.md`, but that gave me a ton of messages like Refusing to invert pattern matching of _+_ because the maximum depth (50) has been reached. Most likely this means you have an unsatisfiable constraint, but it could also mean that you need to increase the maximum depth using the flag --inversion-max-depth=N when checking that the inferred type of an application Vec ? 2 matches the expected type Vec ? (_n_944 + 1) Incomplete pattern matching for UnificationInAgda.Div-v2.with-1208. Missing cases: secondNumber-direct | [] secondNumber-direct | x ? [] when checking the definition of UnificationInAgda.Div-v2.with-1208 Failed to solve the following constraints: ? ? ? ? ? =< ToFun? _As_1575 _B_1574 ? =< ToFun _xs_1173 _B_1147 and no HTML was generated. Is that the expected and desired behavior? > No (see https://github.com/agda/agda/issues/2114). Thanks, left a comment there. From nad at cse.gu.se Tue Nov 3 14:01:30 2020 From: nad at cse.gu.se (Nils Anders Danielsson) Date: Tue, 3 Nov 2020 14:01:30 +0100 Subject: [Agda-dev] A tutorial on inference in Agda In-Reply-To: References: <5d5aafc5-0e90-540c-23c6-9671a5456a06@cse.gu.se> Message-ID: <484148cf-c94e-4793-2867-31248a3f5b49@cse.gu.se> On 2020-11-02 23:21, Roman wrote: > Nils, I tried using the pragma and calling `agda --html > UnificationInAgda.lagda.md`, but that gave me a ton of messages like > [?] and no HTML was generated. Is that the expected and desired > behavior? If you add {-# NON_COVERING #-} right before secondNumber-direct, then you get HTML output. I think that Agda refuses to generate output if there are any non-benign warnings. You can use agda --help=warning to see which warnings are benign and which are not. -- /NAD