/home/laney/.irssi/irclogs/Freenode/2011/#agda/April.log

--- Log opened Fri Apr 01 00:00:56 2011
radicalpumpkinjmcarthur: only latex01/04 00:02
radicalpumpkinjmcarthur: my half-dead syntax highlighter for it supports both though, oddly enough01/04 00:03
radicalpumpkinjust by preprocessing it01/04 00:03
radicalpumpkinsully: can you describe those?01/04 00:03
sullyyes, but not right now01/04 00:04
sullysince I need to finish writing an assignment for my school's programming languages class01/04 00:04
radicalpumpkindamn :)01/04 00:04
sullybut briefly, opaque ascription is a way of hiding the types provided by a structure from user code01/04 00:05
radicalpumpkinwe have an abstract keyword :)01/04 00:05
djahandariejoe6, I packaged up ala which he uses in the first video of that course (if you're talking about the uoregon one). It's pretty unrelated to dependent types though :p01/04 00:05
joe6djahandarie, oh, that is what he uses. I was wondering about it.01/04 00:07
djahandarieHere: http://hackage.haskell.org/package/newtype01/04 00:08
joe6btw, does agda represent an improvement to epigram?01/04 00:08
radicalpumpkinit's an alternative01/04 00:08
radicalpumpkinit has some features epigram doesn't have01/04 00:08
djahandarieHeh. I wouldn't say so, it's different enough to be considered seperately.01/04 00:09
radicalpumpkinbut in many cases is more verbose01/04 00:09
radicalpumpkinepigram 2 will have new features that agda doesn't have yet01/04 00:09
djahandarieWhenever that happens. :p01/04 00:09
joe6which is more actively developed? this irc seems to be more active than the epigram irc..01/04 00:10
radicalpumpkinepigram2 went through a bout of active development a few months ago01/04 00:10
djahandarieI believe Epigram is just Conor.01/04 00:10
radicalpumpkinnah01/04 00:10
djahandarieIt isn't?01/04 00:10
djahandarieWho else works on it?01/04 00:10
kosmikusConor's PhD students, for example.01/04 00:11
pumpkindjahandarie: look at all the people on the sidebar in e-pig.org01/04 00:11
kosmikusalso Edwin Brady, Peter Morris, a few others.01/04 00:11
djahandarieOh yeah, Edwin Brady wrote the Epic backend01/04 00:12
joe6i cannot seem to find any reliable comparisions from google between epigram vs agda01/04 00:12
djahandarieHeh, Ulf Norell works on it?01/04 00:12
pumpkinjoe6: you're in the realm of academic languages that probably fewer than 1000 people have programmed seriously in01/04 00:12
kosmikusI think he's been at one of their hacking weeks.01/04 00:12
joe6anyone with experience on both? which would you recommend for general purpose programming using dependent types?01/04 00:12
kosmikusbut Conor's been at Agda Implementors Meetings as well.01/04 00:13
djahandarieI'd like to go to one of those things01/04 00:13
pumpkinjoe6: I'd stick with agda some more, to learn actual dependent types, and not just writing haskell in agda/epigram01/04 00:13
kosmikusI think Agda is still in a better state right now.01/04 00:13
pumpkinjoe6: then once you know the types, you can switch easily01/04 00:13
joe6ok, thanks.01/04 00:13
djahandarieradicalpumpkin, your doppelganger is here01/04 00:13
djahandarieKill him, fast!01/04 00:13
kosmikusdjahandarie: AIM is next week :)01/04 00:14
* kosmikus will be there01/04 00:14
* pumpkin can't attend :(01/04 00:14
joe6djhanadarie, oh, that is what AIM means..01/04 00:14
djahandariekosmikus, yeah, but isn't it kind of far from wherever I am? :p01/04 00:14
djahandarieNL or something, I don't remember01/04 00:14
kosmikusdjahandarie: I don't know where you are :) it's in Sweden.01/04 00:15
djahandarieAh, Gothenburg.01/04 00:15
djahandarieI'm in the US.01/04 00:15
djahandarieI'm going so many places that I can't go there too :p01/04 00:15
kosmikusyes, quite a distance.01/04 00:15
kosmikusI know the feeling.01/04 00:15
kosmikusthere are far more meetings I'd like to go to than I can actually afford to go to.01/04 00:15
pumpkinxplat: do you have a magic beautiful recipe for making my product bifunctor?01/04 01:01
pumpkinI'm getting tired of writing it myself01/04 01:01
pumpkinprobably not, eh01/04 01:02
joe6interesting: http://personal.cis.strath.ac.uk/~conor/pub/she/ , anyone test-driven her?01/04 01:34
pumpkinyeah, I use it all the time01/04 01:34
joe6pumpkin, you do.. cool, how do you compare it with the dependent types in agda?01/04 01:38
pumpkinvery different01/04 01:44
pumpkinit's still haskell01/04 01:44
joe6pumpkin, there seems to be too many operators in the examples.. looks like perl.. did you feel the same?01/04 01:47
xplatpumpkin: yeah, you probably will have to write it yourself.  but when you write BinaryProducts for Cat some of my stuff should come in handy01/04 01:56
pumpkinI already wrote most of it01/04 01:57
pumpkincool01/04 01:57
djahandarieradicalpumpkin, it's snowing all day tomorrow... rethinking going to Boston. :p01/04 04:44
radicalpumpkin:(01/04 04:45
radicalpumpkinfine, fine, I promise not to bug you about joining GSOC01/04 04:59
sullyon the subject of the programming languages assignment I said I was writing...01/04 07:10
sullythe implementation portion of the previous one I wrote was two hours ago and resulted in mass slaughter01/04 07:10
sully21 of 40 students have handed in01/04 07:10
nappingSun Tzu said:  "If words of command are not clear01/04 07:14
nappingand distinct, if orders are not thoroughly understood, then the general is to blame."01/04 07:14
sullythat certainly is part of the problem01/04 07:16
napping... "But if his orders ARE clear, and the soldiers nevertheless disobey, then it is the fault of their officers."01/04 07:17
sullyand that is the other part.01/04 07:17
sullywell01/04 07:17
sullya big part of the problem was that the students didn't listen to me when I said "this assignment is much harder than the previous ones. you need to start it early."01/04 07:18
nappingYou could probably test that01/04 07:20
nappinger, wrong channel01/04 07:20
nappingbut that's the sort of thing which doesn't seem to work very well01/04 07:20
nappingWhat sorts of programming language assignment?01/04 07:21
sullyimplementing polymorphic type inference01/04 07:21
sullyon a pretty simple language01/04 07:21
nappingin agda?01/04 07:23
sullyin standard ML01/04 07:23
sullyif 40 undergrads were doing agda, that would probably double the number of agda programmers in the world! :P01/04 07:23
nappingwas the last assignment simple type inference?01/04 07:28
nappingI think the let-bound generalization is the trickiest part of H-M type inference01/04 07:33
sullyno, this was the first assignment that was any type inference in this class01/04 07:37
sully(although they have done typecheckers for various languages)01/04 07:37
djahandarieI wish I had a programming language course which required me to implment polymorphic type inference01/04 07:37
djahandarieEasiest assignment ever ;)01/04 07:37
sullydjahandarie: http://www.andrew.cmu.edu/course/15-312-sp11/assignments.html01/04 07:38
djahandarieNot really, but when I read something Oleg wrote about this it actually made things a lot clearer01/04 07:38
sullya lot of them had done simple type inference in a previous class, though01/04 07:38
djahandarieAh nice, you even start from Godel's T and Plotkin's PCF01/04 07:38
sullyif they took it within the last two semesters01/04 07:38
sullythe first three assignments were all decent, but 4 was the first one I was really happy about01/04 07:39
sullyat least with regard to the programming component01/04 07:39
sullynapping: that's definitely true01/04 07:39
sullythe generalization is certainly the trickiest  part01/04 07:39
djahandarieI think what I recently tweeted was from a paper/book thing that nicely covered all this stuff01/04 07:42
djahandarieOh huh, never mind. I was thinking of "The Triumph of Types", but it was shorter than I remember. :p01/04 07:44
djahandarieOkay time to sleep01/04 07:45
sullyoh, 20/40.01/04 07:57
sullyone of the handins still has the functions stubbed out.01/04 07:57
nappingThe GC bar gets green?01/04 08:26
nanothiefI'm currently in the process of learning agda, and have written and understood the basic Nat and Vec data types, see http://hpaste.org/45198/simple_vector_code . I have a couple of questions though. With Nat, the definition of + is very inefficient. Is this optimized by the compiler somewhow? Also, the Fin class is nice, but it is very verbose to write numbers out (eg S (S Z) instead of 2). Can this01/04 11:31
nanothieffixed (eg make it work like the Num class in haskell)?01/04 11:31
nanothief*be fixed01/04 11:31
pumpkinhttp://people.cs.kuleuven.be/~dominique.devriese/agda-non-canonical-implicits/01/04 15:24
nappinginteresting, and apparently not a subtle April Fools joke01/04 15:24
pumpkinyeah, hope not :)01/04 15:24
pumpkinhow do they deal with ambiguous implicits?01/04 15:25
pumpkin(this is feeling a lot like scala :P)01/04 15:26
nappingcomplain?01/04 15:26
pumpkinexcept that here we can actually have more guarantees01/04 15:26
nappingyeah, multiple typeclass instances should be much less of a problem if you use guarantess01/04 15:27
nappingmy idea about automatically naming implicits runs into trouble if there is an argument whose type uses multiple terms which have implicit arguments01/04 15:27
nappingespecially if it's multiple uses of the same temr01/04 15:28
nappingwhy?01/04 15:54
pumpkinwhy to me?01/04 15:57
pumpkinI got disconnected01/04 15:57
nappingwhy to wrong channel actually01/04 15:57
pumpkinoh okay :)01/04 15:57
nappingbut it kind of fits the nice implicit naming scheme not working out01/04 15:57
nappinghttp://www.geocities.jp/takascience/haskell/monadius_en.html01/04 16:02
nappinghmm, still confused01/04 16:02
pumpkinxplat: what's the structure you intend to explore again?01/04 17:02
xplatmonadoid, i.e. noncartesian category object in a category of endofunctors01/04 18:27
copumpkinhow would a category object work?01/04 18:29
xplatthere's an ncatlab article on it01/04 18:47
xplathttp://ncatlab.org/nlab/show/internal+category+in+a+monoidal+category01/04 19:15
xplatthe real details are in the thesis linked from the article01/04 19:19
djahandariecopumpkin, okay I'm going :p01/04 19:21
djahandarieBut I'll probably be a little late due to train timing01/04 19:21
djahandarieBy a little I mean like 30 minutes :p01/04 19:21
djahandarieHm maybe I should just drive all the way01/04 19:26
ymasoryhi all. where should i start learning agda if i'm coming from scala? perhaps "Dependent Types at Work"?01/04 19:33
copumpkinI'd take the first agda tutorial pdf01/04 19:36
copumpkinhttp://www.cse.chalmers.se/~ulfn/papers/afp08/tutorial.pdf01/04 19:36
copumpkinxplat: neat01/04 19:36
copumpkinxplat: oh, so you're wondering if that corresponds to the usual notion of indexed monad à la haskell because a monad is a monoid object, so a "typed monad" should be a category object?01/04 19:37
xplatcopumpkin: i thought at first it might be, but i quickly came to the conclusion that they are different.  which is even cooler because it's an unexplored generalization of monads.01/04 19:52
joe6ymasory, check out ulf's ph.d hypothesis.01/04 20:15
joe6ymasory, if you are new to dtp, check out conor's lectures at Uoregon.01/04 20:16
ymasorythanks guys01/04 20:16
ymasoryyeah, new to dependent types. done some coq, but never used that feature01/04 20:16
copumpkinxplat: ooh01/04 20:17
joe6ymasory, check out Conor's lectures. They are pretty good to understand all the possible options. btw, the idris lang tutorial is also very good.01/04 20:18
joe6it is more geared towards a beginner and goes through the concepts and later on, you can relate that to agda.01/04 20:18
joe6the "power of pi" is also pretty good.. more comparisions with haskell there..01/04 20:19
copumpkinbut the power of pi ignores the power of sigma!01/04 20:19
copumpkinor does it?01/04 20:19
copumpkindjahandarie: awesome01/04 20:20
joe6what is sigma?01/04 20:34
copumpkinjoe6: sigma is like a haskell 2-tuple, but the type of the snd depends on the value of the fst01/04 20:35
copumpkinit can also be seen as a way of encoding a logical existential quantifier in the type theory01/04 20:36
joe6copumpkin, thanks.01/04 20:37
copumpkinsince in constructive logic, an existentially quantified statement is an actual object that satisfies the statement, along with a proof that it satisfies it01/04 20:38
copumpkinyou can't just wave your hands and say "it must exist, but I don't know what it is"01/04 20:38
jmcarthurcopumpkin: it doesn't ignore it entirely01/04 22:10
jmcarthurcopumpkin: there is at least one use of it01/04 22:10
copumpkin?01/04 22:10
copumpkinoh, sigma?01/04 22:10
jmcarthursigma01/04 22:10
copumpkinI was just joking about the name of the paper01/04 22:10
copumpkinI haven't actually read it01/04 22:10
jmcarthur:P01/04 22:10
jmcarthurit's actually pretty neat in a "here's how agda might be useful in the real world" sort of way01/04 22:10
jmcarthurfocusing more on epxressivity than on verification01/04 22:11
copumpkinpff, real world shmeal world01/04 22:11
jmcarthur*expressivity01/04 22:11
Saizanwhich paper?01/04 22:11
jmcarthurpower of pi01/04 22:13
jmcarthurwell, it's verification as well, but not a ton of focus on proofs at least01/04 22:14
--- Day changed Sat Apr 02 2011
joe6jmcarthur, i think we need more papers like that for agda.02/04 00:41
joe6does this function exist in agda library? \\ of Data.List of haskell02/04 02:30
joe6any thoughts on how I can get something like this to scopecheck?02/04 03:11
joe6      where righttoys      = remove nextLeftToys allToys02/04 03:11
joe6            nextLefttoys   = delete firstToy ∘ delete secondToy $ leftToys02/04 03:11
joe6Not in scope: nextLeftToys when scope checking nextLeftToys02/04 03:12
joe6i tried switching the order of the clauses and it did not have any effect.02/04 03:12
xplatnextLeftToys != nextLefttoys02/04 03:13
xplat(and you probably need to switch the order too)02/04 03:14
joe6oh, shoot. Thanks02/04 03:14
joe6sorry about that..02/04 03:14
joe6xplat, do you know why this would not work?02/04 03:17
joe6map (λ (_∷_ f (_∷_ s [])) → buildTree toys f s)02/04 03:17
joe6this is what agda says: expected sequence of bound identifiers )<ERROR> → buildTree toys f02/04 03:17
joe6just curious, will such pattern matching work in a lambda expression?02/04 03:19
joe6xplat, any thoughts, please?02/04 03:25
joe6is there a 'delete one element from vector" function?02/04 03:55
copumpkindjahandarie: greetings!02/04 05:44
joe6copumpkin, what am I doing wrong, here?02/04 05:47
joe6LeftToys : {n : ℕ} → Set02/04 05:47
joe6LeftToys = Vec Toy n02/04 05:47
joe6i am just doing "type LeftToys = Vec Toy Nat" of haskell in agda.02/04 05:47
copumpkinthe n is not in scope at the term level02/04 05:47
copumpkinbring it into scope by writing LeftToys {n} = Vec Toy n02/04 05:47
joe6gotcha, thanks.02/04 05:48
joe6copumpkin, how can I remove an element from a vector? I had filter when using lists, but, filter could delete more than 1 element and am not sure if that will work with vectors.02/04 05:50
joe6copumpkin, any suggestions, please?02/04 05:50
joe6delete : {n : ℕ} → Toy → Vec Toy (suc n) → Vec Toy n02/04 05:50
joe6delete toy toys = filter (λ a → not (a == toy)) toys02/04 05:50
joe6copumpkin, this is where I am..02/04 05:50
copumpkinthat type can't be right02/04 05:50
copumpkinyou have a filter?02/04 05:51
copumpkinthe problem there is that you don't know how many elements you'll be removing02/04 05:52
joe6nope, that is the remnant from the list that I had instead of vectors..02/04 05:52
joe6copumpkin, i am trying to go from lists to vector02/04 05:52
joe6copumpkin, yes, that is what I realised.02/04 05:53
copumpkinwell, the problem with vector is that it's tougher to say what the return n value will be02/04 05:53
joe6copumpkin, and I need some way to just remove the first element.02/04 05:53
copumpkinyou could still write it, but it'd be super ugly02/04 05:53
copumpkinwith a function in there02/04 05:53
copumpkinbut you don't even have a guarantee that the specified Toy was in the Vec to begin with02/04 05:53
joe6copumpkin, can I just delete the first element, then I will what n will be?02/04 05:53
copumpkinoh, the first of the whole vector?02/04 05:54
copumpkinthat's just tail02/04 05:54
joe6copumpkin, it will be there in my case..02/04 05:54
copumpkinyeah, but the type system needs a guarantee02/04 05:54
joe6copumpkin, sorry, I meant first occurrence.02/04 05:54
joe6copumpkin, not the first element.02/04 05:54
copumpkinso you'd ideally want a Toy called x, a Vec Toy (suc n) called xs, and a proof, that x is in xs02/04 05:54
copumpkinthen you can return Vec Toy n02/04 05:54
copumpkinluckily the Vec module already has the notion of such a proof02/04 05:54
joe6copumpkin, yes that is what I want to do.02/04 05:55
copumpkinhttp://www.cse.chalmers.se/~nad/listings/lib/Data.Vec.html#73402/04 05:55
copumpkinthat's the type of the proof you want02/04 05:55
joe6copumpkin, but, I am not sure of how I can find the first occurrence of the element in the vector.02/04 05:55
copumpkinyou also can't use a Bool there02/04 05:55
copumpkinthat proof conveniently tells you where it is02/04 05:55
copumpkinthen the question is how do you grab such a proof ;)02/04 05:55
joe6copumpkin, I want a running program, not the proof.02/04 05:55
copumpkinthese types are logical statements02/04 05:56
copumpkinby writing Toy -> Vec Toy (suc n) -> Vec Toy n02/04 05:56
copumpkinyou are making a logical statement that "if you give me a toy and a vec of toys of length n + 1, I will ALWAYS give you a vec of toys of length n02/04 05:56
copumpkinyou can't just wave your hands and say "this will be true in my case"02/04 05:56
copumpkinbut if you take the proof I mentioned, you will have a running program02/04 05:57
copumpkinproofs and programs are not distinct things02/04 05:57
copumpkinthey differ in how you think about them02/04 05:57
joe6copumpkin, with that link, did you mean "here"?02/04 05:57
copumpkindata _∈_ {a} {A : Set a} : A → {n : ℕ} → Vec A n → Set a where02/04 05:58
copumpkin  here  : ∀ {n} {x}   {xs : Vec A n} → x ∈ x ∷ xs02/04 05:58
copumpkin  there : ∀ {n} {x y} {xs : Vec A n} (x∈xs : x ∈ xs) → x ∈ y ∷ xs02/04 05:58
copumpkinthat bit02/04 05:58
copumpkinit's a data type that takes two parameters02/04 05:58
copumpkinyou can write something like02/04 05:58
copumpkin5 ∈ 6 ∷ 4 ∷ 7 ∷ 5 ∷ 2 ∷ []02/04 05:58
copumpkinthat is a type02/04 05:59
copumpkina value of that type will be composed of combinations of heres and theres02/04 05:59
joe6copumpkin, thanks, I am still trying to figure out what you mentioned, by trying out the code that you wrote..02/04 06:06
joe6copumpkin, hence, the delay.02/04 06:06
copumpkinah okay :)02/04 06:06
copumpkinI'd write something like x : 5 ∈ 6 ∷ 4 ∷ 7 ∷ 5 ∷ 2 ∷ []02/04 06:06
copumpkinthen x = ? on the next line02/04 06:06
copumpkinthen C-c C-a in the hole02/04 06:07
copumpkinagda should write the proof for you02/04 06:07
joe6copumpkin, oh, cool..02/04 06:07
joe6copumpkin, will try that.02/04 06:07
joe6copumpkin, to use that, I would have to know the exact position of the element in that list of vectors?02/04 06:12
copumpkinyeah, and you'd write a function that provides a Dec of that type :)02/04 06:14
copumpkinwhich is essentially the find function02/04 06:14
copumpkinexcept that instead of providing a Maybe Int telling you the index02/04 06:14
joe6copumpkin, btw, how did you know the C-c C-a ? it is not in the agda menu on my emacs..02/04 06:14
copumpkinit gives you a much smarter index and a much smarter bool02/04 06:14
joe6copumpkin, ok, makes sense. will do.02/04 06:14
copumpkinjoe6: there's a wiki page on it02/04 06:14
joe6i can see how agda is a lot safer than programming in haskell. the only errors I get in haskell are the empty head or unknown index kind of errors. and, those are gone when using these kind of vectors..02/04 06:16
joe6i know that this can be done in haskell too.02/04 06:17
joe6copumpkin, thanks for your help. I am off to bed. see you in the morning..02/04 06:18
copumpking'night :)02/04 06:19
joe6i can understand why the compiler complains about this code: http://pastebin.com/prv2UZdW , but am not sure of how to fix it.. Any suggestions, please?02/04 15:15
dolioYou need to come up with a signature that allows you to return either a 'Vec Toy (1+n)' or a 'Vec Toy n'.02/04 15:17
dolioBecause you're returning both depending on the branch.02/04 15:17
joe6unless I do something like this: -- the last item must be what we are searching for02/04 15:19
joe6delete toy (x ∷ [])   = []02/04 15:19
joe6dolio, thanks, will think about it.02/04 15:20
joe6dolio, is it possible to have a type signature with such different returns?02/04 15:20
dolioYes.02/04 15:20
joe6dolio, off the top of your head, can you think of any function in the standard lib that has that type signature?02/04 15:22
joe6dolio, so, I can study and understand it.02/04 15:22
dolioHave you heard of this type called Either in Haskell?02/04 15:22
dolioIt's called \uplus in Agda.02/04 15:23
Saizanin Data.Sum02/04 15:30
joe6dolio, Saizan, thanks.02/04 15:37
joe6Saizan, did you mean Data.Plus?02/04 15:43
Saizanno, Data.Sum02/04 15:44
joe6this one, _-⊎-_ : ∀ {a b c d} {A : Set a} {B : Set b} (A → B → Set c) → (A → B → Set d) → (A → B → Set (c ⊔ d))02/04 15:47
joe6or, data _⊎_ {a b} (A : Set a) (B : Set b) : Set (a ⊔ b)02/04 15:48
Saizanthe latter02/04 15:48
joe6what does this symbol "⊔" signify?  is it an or?02/04 15:49
Saizanit's the "least upper bound" operator02/04 15:50
joe6Saizan, thanks.02/04 15:50
Saizanbasically _⊎_ lives in an universe that's the maximum of the two universes of it's parameters02/04 15:51
Saizan*its02/04 15:51
xplatgood old grothendieck universes indexed by a prefix of the ordinals02/04 16:00
xplatam i right that Agda's logic assumes ω many universes?02/04 16:01
dolioYes.02/04 16:02
xplat(and no more)02/04 16:02
dolioActually, with universe polymorphism, there's ω+1.02/04 16:02
xplatah, but you can't refer to the ωth universe explicitly, you can just construct things that imply it exists ...02/04 16:03
dolioYeah.02/04 16:03
dolioYou can get Agda to tell you that something inhabits Setω.02/04 16:04
dolioBut if you try to construct a datatype that inhabits it, you'll get an error, for instance.02/04 16:04
dolioI think it could probably be handled better.02/04 16:05
Saizanis there any work on taming inconsistency with something that doesn't involve stratification into universes?02/04 16:06
xplatthere's a set theory that stratifies propositions rather than sets, but that distinction is pretty meaningless for DTT02/04 16:07
xplatand you could say ZF doesn't stratify, it just refuses to talk about some things02/04 16:08
joe6is this how it is used? http://pastebin.com/p0wmqGAg02/04 16:08
copumpkinno proof that it's in there? :(02/04 16:08
Saizanjoe6: not quite02/04 16:09
Saizanjoe6: like in haskell you've to use the two constructors Left and Right, here you've to use inj\_1 and inj\_202/04 16:10
xplatparaconsistent logic for foundations might be another approach, but i've never heard of any substantial work in that area (doesn't mean it doesn't exist!)02/04 16:10
joe6like this.. http://pastebin.com/JMZcG9HL02/04 16:12
xplati'm not sure if i'd recommend using vectors for set-like operations in Agda, they seem to carry an index that's unnatural for the problem and only likely to get in the way02/04 16:12
Saizanyep02/04 16:12
joe6xplat, the problem with using lists is that they are not passing the termination checker.02/04 16:13
joe6xplat, i am not sure if your comment was directed to me.02/04 16:13
xplatjoe6: mostly02/04 16:14
xplatjoe6: what did you write that you thought would do what you wanted but didn't pass TC?02/04 16:15
joe6xplat, this: http://pastebin.com/HbY51Eym02/04 16:21
joe6xplat, it could also be my in-experience. If i could convert the deletes to eat the constructors, then I think it will pass TC.02/04 16:22
joe6xplat, vectors : agda :: lists :: haskell ?02/04 16:22
joe6xplat, vectors : agda :: lists : haskell ?02/04 16:22
copumpkinyou can write vectors in haskell02/04 16:23
xplatjoe6: and you can write lists in agda02/04 16:25
joe6copumpkin, yes, but it seems to have lesser errors to use vectors in agda.02/04 16:25
xplatjoe6: what problem are you trying to solve?  it's not obvious to me from the code ...02/04 16:25
xplat(maybe it would be if i stared at it a lot longer)02/04 16:25
joe6xplat, http://web.engr.oregonstate.edu/~erwig/zurg/02/04 16:26
joe6xplat, my objective is to learn agda rather than solve that problem.02/04 16:27
xplatah.  i have to go now, but i'll take a look when i return02/04 16:27
joe6xplat, the problem is my application of agda to that.02/04 16:27
xplatyes but to know the appropriate techniques to recommend i have to know the problem02/04 16:28
joe6xplat, i am using the problem to learn agda.02/04 16:28
joe6xplat, yes, i agree.02/04 16:29
joe6what am i doing wrong here: http://pastebin.com/KgDRXUNe02/04 16:53
Saizanthe problem is that toys is not guaranteed to be of type Vec a (suc something), also "{toys : Vec Toy (suc n)}{toy0 : Toy}" in the type signature doesn't make sense02/04 16:55
Saizandelete toy (toy0 ∷ t ∷ oys) = if toy0 == toy then (inj₁ toys) else (delete toy (t ∷ toys)) -- should work02/04 16:57
joe6Saizan, sorry, yes, that makes sense.02/04 16:57
joe6Saizan, is this what you meant? delete toy (toy0 ∷ t ∷ toys) = if toy0 == toy then (inj₁ (t ∷ toys))02/04 17:02
joe6 else (delete toy (t ∷ toys))02/04 17:02
Saizanah, yes, sorry02/04 17:04
joe6Saizan, this is what it says now: http://pastebin.com/7kLi6JMq02/04 17:07
Saizanthat's because you've to cons toy0 on the front of whatever delete produces02/04 17:09
joe6Saizan, makes sense. thanks.02/04 17:10
joe6is there a debug mode to get more details on the error messages that agda returns?02/04 17:40
Saizanno02/04 17:41
joe6--verbose=N                                 set verbosity level to N02/04 17:41
joe6Saizan, sorry for bothering you. I cannot get something as simple as this to work. http://pastebin.com/wuTc00W402/04 17:48
joe6Saizan, i put in the assumption that if there is one last element, then it must be what we are searching for.02/04 17:48
joe6Saizan, so, I do not have to worry with the \uplus operator02/04 17:49
Saizanyou still need to make sure the argument to delete is of type Vec Toy (suc _) like before, also you flipped the arguments to _::_02/04 17:50
joe6Saizan, oh, ok.02/04 17:50
joe6Saizan, any thoughts, please? http://pastebin.com/GVP1WeEx02/04 17:55
Saizanhttp://pastebin.com/chDhR9Wd02/04 17:59
joe6Saizan, thanks. sorry about that. silly mistake.02/04 18:02
joe6is there (\\) for vectors in agda?02/04 18:30
copumpkinit'd have to have a complicated type02/04 18:31
copumpkinI don't think there's one in the standard library02/04 18:31
joe6copumpkin, yeah. I tried to copy the haskell "(\\) =  foldl (flip delete)" and it wouldn't fly..02/04 18:34
copumpkinit'd probably work for agda lists02/04 18:34
copumpkinbut for vectors you need your type to be aware of the final length02/04 18:35
copumpkinwhich is a nontrivial computation02/04 18:35
copumpkinthe alternative is to say that you return a "there exists an n such that you have a vector of length n"02/04 18:35
joe6copumpkin, any thoughts on a function that can delete elements of a vector which are in second vector02/04 18:35
copumpkinbut that's equivalent to a list02/04 18:35
copumpkinyou'd need to stop and think a while about what the final length would be02/04 18:36
joe6copumpkin, tried something like that: remove : {from toDelete resultLen : ℕ} → Vec Toy (toDelete + resultLen) → Vec Toy toDelete → Vec Toy resultLen02/04 18:37
joe6copumpkin, but that wouldn't fly..02/04 18:37
copumpkinthe relationship is a bit stricter than that02/04 18:39
copumpkinwhat if I write remove [1,2,3] [4]02/04 18:40
copumpkin(assuming I can write lists in haskell notation)02/04 18:40
Saizanmh, maybe in your case you want lists indexed by an upper bound on their length, rather than their exact length02/04 18:40
copumpkinthat's an idea02/04 18:40
copumpkinyou can do a trick like Fin does02/04 18:40
copumpkinbut it's not as precise02/04 18:40
Saizani've never worked with those though02/04 18:40
joe6copumpkin, that is beyond my expertise level at this point. I was hoping something that can delete where I know that the first vector contains that element.02/04 18:40
copumpkinjoe6: think of what "I know that" means?02/04 18:41
copumpkinknowledge in agda means you have a proof of it ;)02/04 18:41
copumpkinthat's what I was trying to get you to do yesterday02/04 18:41
joe6copumpkin, i have no clue about proofs. I tried the coq tutorial but they seemed to have precondition and postcondition and all that.02/04 18:43
copumpkinI'd start with the very basics02/04 18:43
Saizanyeah, delete :: {x : Toy} {n : Nat}{v : Vec Toy (suc n)) -> x \in v -> Vec Toy n -- this would be easy to write, with the right datatype for \in02/04 18:43
copumpkinthat agda tutorial pdf goes over it pretty well02/04 18:43
copumpkinthere is already an \in in Data.Vec02/04 18:43
joe6copumpkin, any suggestions on where I can find material that can address the basics?02/04 18:43
copumpkinthat's what I was suggesting yesterday02/04 18:43
copumpkinjoe6: I'm just going to keep linking to http://www.cse.chalmers.se/~ulfn/papers/afp08/tutorial.pdf :P02/04 18:44
copumpkinI guess it assumes decent haskell knowledge02/04 18:44
joe6copumpkin, haha.. I have that tutorial open too. will read that again..02/04 18:44
starcloudedhello everybody02/04 19:39
copumpkinhi02/04 19:39
joe6has anyone tried this? http://people.cs.kuleuven.be/~dominique.devriese/agda-non-canonical-implicits/02/04 19:42
joe6any likes/dislikes?02/04 19:42
copumpkinI haven't tried it, but it definitely seems interesting02/04 19:43
joe6copumpkin, there is no case statement in agda2?02/04 20:10
joe6copumpkin, is there no case statement in agda2?02/04 20:10
copumpkinno02/04 20:10
joe6copumpkin, ok, thanks.02/04 20:10
copumpkinit'd have strange behavior in the presence of dependent types02/04 20:10
copumpkinhmm, a few days ago I said a Setoid is like Haskell's Eq02/04 20:12
copumpkinbut I guess a DecSetoid is more like Haskell's Eq02/04 20:12
joe6copumpkin, when I use ? and do "Show Goals", it just seems to replace the ? with zero. I see that the tutorial has a C-c C-x + to show a depth of 100. http://pastebin.com/LpQghNpx02/04 20:42
joe6copumpkin, does that functionality not work anymore.02/04 20:42
joe6copumpkin, it says C-c C-x + is undefined.02/04 20:45
joe6copumpkin, is there a mechanism to show a lot of goals?02/04 20:45
copumpkinhmm, it doesn't show you all the goals when you first load the file?02/04 20:47
copumpkinhttp://wiki.portal.chalmers.se/agda/pmwiki.php?n=Docs.EmacsModeKeyCombinations02/04 20:47
joe6copumpkin, no, it doesn't though it has the "All Goals" window open.02/04 20:52
copumpkinhuh?02/04 20:52
copumpkinthe ? should disappear02/04 20:52
copumpkinand turn into { }002/04 20:52
copumpkinor { }102/04 20:52
copumpkinor something02/04 20:52
copumpkinthen in the bottom window, you should have ?0 : sometype02/04 20:53
copumpkin?1 : sometype02/04 20:53
lambdabotMaybe you meant: . ? @ v02/04 20:53
copumpkinno, I didn't, thank you02/04 20:53
joe6copumpkin, yes, it turns to { }002/04 20:54
joe6copumpkin, yes, it does show the type of { }002/04 20:56
copumpkinthen if you put your cursor inside { }0 can do C-c C-,02/04 20:56
copumpkinit should  give you a normalized type for your goal, and (almost) all the variables you have in scope02/04 20:57
copumpkintheir types02/04 20:57
joe6copumpkin, it says "Goal: Nat" and a line below it. Nothing else..02/04 20:58
copumpkinthat probably means you have no other variables in scope02/04 20:58
copumpkin(it doesn't show you top-level definitions)02/04 20:58
copumpkinf x y 0 = { }002/04 20:59
copumpkinif you do C-c C-, in there, it'd show you x and y and their types02/04 20:59
joe6copumpkin, ok, will do02/04 20:59
Saizanhttp://pastebin.com/9Uav0D1C <- why so ugly?02/04 21:00
copumpkinwait, you need all those implicits?02/04 21:01
copumpkinouch, pred :P02/04 21:01
copumpkinbut I guess it isn't that bad02/04 21:01
Saizanthe one without pred is ugly too02/04 21:02
copumpkinyeah, but why so many implicits?02/04 21:02
copumpkindelete {A} {x} .(x ∷ xs) (here {n} {.x} {xs}) = xs02/04 21:02
joe6Saizan, thanks. will check it out.02/04 21:02
copumpkinoh, {A} is just to get at {x}02/04 21:02
Saizanyep02/04 21:02
Saizani could do without {A} {x} by using _ for x02/04 21:03
copumpkinif you remove the implicits from the here constructor, it breaks?02/04 21:03
copumpkinyeah02/04 21:03
Saizanhttp://pastebin.com/JXR3qMkL <- somewhat better, but 4 cases seem too many02/04 21:07
danrdelete' xs here = tail xs02/04 21:11
danrdoesn't that work?02/04 21:11
Saizanno02/04 21:15
Saizanx ∷ xs' != xs of type Vec A (suc n')02/04 21:15
Saizanwhen checking that the pattern here has type x ∈ xs02/04 21:15
joe6Saizan, thanks.02/04 21:15
Saizan*3 cases, btw, i meant to say02/04 21:17
Saizanjoe6: np02/04 21:17
joe6Saizan, once i get my head around it, I will submit it as a patch to the std lib. Is that ok?02/04 21:37
joe6does agda show things like "?0 : _72"... the _72 makes no sense to me. Is there a way to see what it means or is referring to?02/04 21:45
Saizanjoe6: sure02/04 21:46
joe6i can understand that it is trying to tell me that it can make the goal to _72.02/04 21:46
joe6but, am not sure what _72 is?02/04 21:46
xplat_72 is a goal for a _02/04 21:46
Saizan_72 stands for a yet unspecified type02/04 21:47
xplat(or an implicit argument, which is syntax sugar for a _)02/04 21:47
Saizanit's the name of a metavariable used during type inference02/04 21:47
xplator it can be a part of a goal which is partially satisfied02/04 21:47
Saizanthe type checker might have some constraint about it but it doesn't really know what it should be02/04 21:48
Saizanyou probably also have some function calls marked in yellow?02/04 21:48
joe6is this a constant number? i noticed these kind of numbers when I was having some compilation errors before too.02/04 21:49
Saizanno, they can change02/04 21:49
joe6ok, thanks.02/04 21:50
Saizanthey are automatically generated during type checking02/04 21:50
Saizanjoe6: anyhow, if you have some yellow, you can try explicitly giving some of the implicit arguments, then such variables should go away02/04 21:50
Saizanjoe6: or you could put ? for them, so at least instead of a _72 you'll get something like ?1 and you'll know what it refers to02/04 21:51
joe6Saizan, I was trying out section 3.3.3 of the agda tutorial, it tells me to try and see what happens with this: Append the line “foo’::? = ?” at the end of “Intro.agda”,02/04 21:51
joe6the syntax is agda1, i believe, so, i converted it to agda2 and tried it.02/04 21:52
joe6Saizan, thanks for the explanation. I think i get the purpose behind it.02/04 21:52
Saizanah, there you could do "foo’::? : ?; foo’::? = ?", then you'll get something like "?0 : Set _n; ?1 : ?0" as goals02/04 21:53
joe6Saizan, thanks, wil try that02/04 21:55
xplatthis riddle seems almost too simple to write a program for02/04 23:45
--- Day changed Sun Apr 03 2011
augurpumpkin: hm. well, im not entirely sure my goals right now but hopefully it'll be useful to use agda.03/04 04:28
augurokies. agda install.. complete?03/04 04:29
pumpkinagda-mode setup iirc03/04 04:29
pumpkintype that03/04 04:29
augurhm. i did cabal install agda03/04 04:29
augurthe uh.. wiki says to do happy and alex first, then Agda-executable03/04 04:29
augurwas this in error?03/04 04:30
pumpkinwell, if you don't have them, it'll fail03/04 04:30
pumpkinbut you probably have them?03/04 04:30
augurit didnt, it seems03/04 04:30
augurfail, i mean. no errors reported, that i can see03/04 04:32
xplatyou should get haskell-mode too03/04 04:33
xplatagda-mode needs it03/04 04:33
augurcabal install haskell-mode?03/04 04:34
xplati mean, assuming you don't have it already03/04 04:34
augurcabal says no package named haskell-mode03/04 04:34
xplatyeah, it was on a project page03/04 04:34
auguroh ok03/04 04:34
augurmm.. doesnt seem to exist on the page anymore03/04 04:37
pumpkinyeah, it moved somewhere03/04 04:38
pumpkinI think aquamacs comes with it though03/04 04:38
pumpkinI don't think I had to install it03/04 04:38
auguraquamacs doesnt seem to have it in its modes list but03/04 04:38
auguroh! maybe it does!03/04 04:40
augurit seems so!03/04 04:41
augurwhere would agda-mode be?03/04 04:42
pumpkinwhen you installed agda03/04 04:42
pumpkinit put a binary into your .cabal/bin03/04 04:43
auguroh ok03/04 04:43
pumpkinif you type agda-mode setup it'll set up your emacs03/04 04:43
augureh.. $ agda-mode ??03/04 04:43
augurthis does nothing03/04 04:43
pumpkindoes it find the program?03/04 04:43
pumpkinis ~/.cabal/bin on your PATH?03/04 04:43
auguroh i should check03/04 04:44
auguralso, it would help if i remembered how to do that :D03/04 04:44
pumpkinwell if you type agda-mode into your shell03/04 04:44
pumpkindoes it say anything?03/04 04:44
augurno no it doesnt know the command03/04 04:44
pumpkinThis program, which is part of Agda version 2.2.11, can be run03/04 04:44
pumpkinin two modes, depending on which option it is invoked with:03/04 04:44
pumpkinah, so it probably ins't03/04 04:44
pumpkinisn't03/04 04:44
augurwhats the location of the PATH config file03/04 04:44
pumpkinopen .profile, and add03/04 04:45
pumpkinexport PATH=/Users/<yourusername>/.cabal/bin:$PATH to it03/04 04:45
augurhooray03/04 04:45
pumpkinthen you need to restart your shell, or source the profile file03/04 04:46
augurhm03/04 04:47
auguri did the setup, but aquamacs doesnt seem to be doing anything with .agda files03/04 04:47
pumpkindid you restart it?03/04 04:47
auguryeah03/04 04:48
pumpkinalso, it won't highlight them until you've loaded the file03/04 04:48
pumpkinC-c C-l03/04 04:48
pumpkin(ell)03/04 04:48
augurhm03/04 04:51
auguri must be doing something wrong03/04 04:51
nappingfor some reason, the package broke03/04 04:58
nappinghttp://hpaste.org/45236/cabal_errors03/04 04:58
augurpumpkin: so when i do control-c control-l, it tells me theres a parse error03/04 05:00
augur:(03/04 05:00
pumpkinthere probably is?03/04 05:00
pumpkindo you have a module MyFileNameMinustTheAgdaPart where at the top?03/04 05:00
augurno should i?03/04 05:01
pumpkinyes03/04 05:01
auguroic03/04 05:01
augurright03/04 05:01
augurive never understood this whole module thing03/04 05:01
augurwoo! it works!03/04 05:02
pumpkinisn't it pretty when it goes from black and white to color!03/04 05:02
auguroh yes definitely03/04 05:02
augurso, pumpkin, how does this conversation-with-the-type-checker thing work03/04 05:11
pumpkinstick a question mark into an expression somewhere03/04 05:12
pumpkinthen C-c C-l03/04 05:12
pumpkinit'll turn magic!03/04 05:12
augur?03/04 05:13
pumpkinwrite x = ?03/04 05:13
pumpkinand then load the file03/04 05:13
auguri get { }003/04 05:14
augur:(03/04 05:14
auguri dont know what to do now!03/04 05:14
copumpkinthat's a hole03/04 05:15
copumpkinyou can ask for its type03/04 05:15
copumpkinor do things in it03/04 05:15
copumpkinunfortunately it doesn't have a defined type03/04 05:15
copumpkinbecause you have nothing else on x03/04 05:15
copumpkinanyway, follow that tutorial :)03/04 05:15
augurhm03/04 05:18
augurthis tutorial doesnt mention that in any real detail03/04 05:19
auguri dont get ittt03/04 05:21
augursoo... can agda code actually be executed? lol03/04 05:46
copumpkinsure, you can compile it, but I can't remember how03/04 05:47
copumpkinyou can also C-c C-n03/04 05:47
augurlol03/04 05:47
auguryou dont remember how03/04 05:47
copumpkinand type in an expression to "evaluate"03/04 05:47
augur<303/04 05:47
copumpkinC-c C-x C-c maybe?03/04 05:47
auguri like that you dont actually run your agda code03/04 05:48
copumpkinif you can prove it will do the right thing when run, why bother running it? :P03/04 05:48
auguri suppose!03/04 05:48
augurim not sure how to do any proving yet tho :(03/04 05:49
augurbut!03/04 05:49
augurthats the section im on03/04 05:49
augurso lets see03/04 05:49
copumpkinyay03/04 05:49
augurcopumpkin: do you usually indent everything under module?03/04 05:52
copumpkinnope03/04 05:52
augurwow, very little in the way of types are provided upfront, huh03/04 05:53
nappingdo you have the library installed?03/04 05:53
augurdunno!03/04 05:54
augurim not complaining, just observing03/04 05:54
copumpkinthe only thing you get up front is Set, Set1, Set2, and so on03/04 05:54
copumpkin:)03/04 05:54
nappingbut no, there are few if any types available without explicitly importing03/04 05:54
copumpkinnothing else03/04 05:54
augurcopumpkin: nifty03/04 05:54
auguragda's pretty hardcore03/04 05:54
auguryou want it? make it yourself, punk.03/04 05:54
copumpkinyou can also write that as Set, Set\_1, Set\_2, and so on03/04 05:54
copumpkinif you want to make a type for universe levels, you can parametrize Set by an actual number03/04 05:54
augurhmm03/04 06:05
auguri should head home03/04 06:05
napping"and so on" being Set\_3?03/04 06:06
pumpkinwhatever subscripts you want to write on it03/04 06:07
pumpkinnumeric ones03/04 06:07
pumpkinI think it'll accept Set\_3\_5\_203/04 06:07
pumpkinif you really need that one03/04 06:07
nappingah03/04 06:07
nappingI didn't think about using more digits03/04 06:07
pumpkinnot that I've ever tried it03/04 06:07
pumpkinI remember the days when we had Vec and Vec103/04 06:08
nappingIt seems to work. Also Set₀ = Set03/04 06:24
pumpkinyeah03/04 06:24
augurhmm03/04 06:30
augurwhat kinds of propositions are functions proofs of?03/04 06:30
auguri feel ive read both implication and universal quantification03/04 06:30
pumpkinany kinds of propositions03/04 06:31
augur?03/04 06:31
pumpkinyou can state just about anything you can imagine03/04 06:32
nappingfunctions prove arrow types03/04 06:33
nappinga non-dependent function is like implicatin03/04 06:33
nappinga dependent type is like quantification03/04 06:33
augurhmm03/04 06:34
augurnight yo03/04 06:54
pumpkinnight :)03/04 06:55
jlouisAgda users: why is Agda not liking my 'merge' definition here (it is red in the Emacs mode): https://gist.github.com/900286 why? And how do I get information about what is wrong?03/04 09:26
jlouisI am working myself through "Why dependent types matter" by McBride, Altenkirch and McKinna03/04 09:29
Saizanjlouis: red means it doesn't pass the termination checker03/04 12:59
Saizanjlouis: and the problem is the with03/04 12:59
Saizani think so, at least, like in this thread: https://lists.chalmers.se/pipermail/agda/2011/002760.html03/04 13:02
jlouisSaizan: NAD is the mailing list helped me03/04 13:41
jlouisIt is the termination checker that has trouble with the with-statement03/04 13:41
jlouisI dropped in a workaround by making the recursive calls explicit03/04 13:41
jlouisit is ugly, but it works :P03/04 13:41
Saizanheh03/04 13:42
Saizanbeing an oracle it wants sacrifices from time to time03/04 13:43
jlouisI got a bit further in the development: https://gist.github.com/b0fb3b184029e1d30547 my problem is now: "How do I use my Lemma plusSuc to convince Agda this holds?". I've looked into 'subst' from PropEq (Core) but I can't get it to work03/04 17:37
copumpkinmatch on that p03/04 17:40
copumpkinor you can use subst or rewrite03/04 17:40
copumpkineasiest way is to ask agda to match on it for you03/04 17:41
copumpkinC-c C-c p03/04 17:41
Saizanjlouis: with subst: vrevacc {X} {suc k} {m} (vcons x v) ys = subst (Vec X) (plusSuc k m) (vrevacc v (vcons x ys))03/04 17:43
Saizanvrevacc {X} {suc k} {m} (vcons x v) ys rewrite sym (plusSuc k m) = vrevacc v (vcons x ys) <- with rewrite03/04 17:44
jlouisthanks03/04 17:46
Saizanthe ugly one is using with directly:03/04 17:47
Saizanvrevacc {X} {suc k} {m} (vcons x v) ys with suc (k + m) | plusSuc k m03/04 17:47
Saizanvrevacc {X} {suc k} {m} (vcons x v) ys | .(k + suc m) | refl = vrevacc v (vcons x ys)03/04 17:47
jlouismm, I like the subst version better03/04 17:47
jlouisbut perhaps it is just me03/04 17:47
copumpkinsubst is mostly obsoleted by rewrite, in my experience03/04 17:48
Saizansubst is annoying when the first argument gets large03/04 17:48
Saizanotherwise it's nice to not have to rely on not 100% reliable syntax sugar03/04 17:49
copumpkinwhat's annoying is when even with doesn't work03/04 17:49
copumpkinand you have to manually make a helper function03/04 17:49
augurooh03/04 18:06
auguri found an error in the DTaW paper03/04 18:06
Saizanall these tutorials should be moved to wiki form, easier to link to specific parts and correct them03/04 18:13
augurindeed03/04 18:17
augurits just in the section defining the disjoint union03/04 18:18
augurthey write _+_ : Set -> Set -> Set where A + B = A \/ B03/04 18:18
Saizanpage?03/04 18:20
Saizanah, 23, found it, why is it an error?03/04 18:21
augurits a function definition not a type def03/04 18:21
augurwait maybe i misread03/04 18:22
joe6xplat, it was not about solving the puzzle, it is about me trying to learn agda and about search problems.03/04 18:22
augurD:03/04 18:22
auguri think i misread. how freaky. i would swear i saw a where in there03/04 18:22
augurX_X03/04 18:23
augur@_@03/04 18:23
augur<>_<>03/04 18:23
xplatjoe6: i mean it's hard for me to think about how to write a program to solve that problem because i keep going so far the answer is already there at compile time :)03/04 18:28
xplataugur: last night you asked about function types and what they prove03/04 18:32
auguroh hey03/04 18:32
auguryeah, im reading this paper and its cohereing with what i thought03/04 18:32
augurnamely, functions ~ implication03/04 18:32
auguri still have to get into the mode of thought that elements of Set are propositions03/04 18:32
augurand elements of those elements are witnesses03/04 18:32
xplata function (x : A) -> B x says 'if you give me an x that is an A i will give you a proof of B x'03/04 18:33
augurright03/04 18:33
xplatso if A is a proposition and B is a constant proposition, that reads 'if you give me a proof of A i will give you a proof of B'--implication03/04 18:34
joe6xplat, oh, ok.03/04 18:35
xplatif A is a type of 'individuals' like Nat and B is a property (a proposition that depends on its argument), it says 'if you give me any A i will give you a proof that B holds of it'--universal quantification03/04 18:35
joe6xplat, would you mind pastebin'ing your efforts. I do not care about the complete solution, but the approach that you took to solve the problem.03/04 18:36
joe6xplat, i bet there is a lot I can learn from your efforts.03/04 18:37
augurxplat: hm03/04 18:38
auguri suppose that makes sense!03/04 18:39
auguris there a way to use small whitespace in agda? pairs are horrible spacey03/04 21:58
copumpkindunno03/04 21:59
augurwhoaaaa i can do latex?! oh man this is great03/04 22:00
augurholy03/04 22:00
copumpkinit's pseudolatex03/04 22:01
copumpkinbut yeah, that's how we get all the horrifying unicode characters03/04 22:01
auguri love unicode characters in my code :D03/04 22:02
xplatjoe6: the main things to learn from me about this problem: 1) parameterize the problem on the number of toys 2) represent each toy by an element of Fin n 3) represent the state by a flashlight position (data Side : Set where Left Right : Side) plus a Vec n Side for the positions of the toys03/04 22:03
xplat(provide a Vec n String of names for the toys and a Vec n Nat of transit times)03/04 22:06
augurcopumpkin: :(03/04 22:06
copumpkin?03/04 22:06
augurit tells me \to is a parse error! :(03/04 22:06
auguroh, is \to == ->?03/04 22:06
auguroh man03/04 22:07
copumpkinI use \r03/04 22:07
augurtalk about hardcore!03/04 22:07
augurwow, it seems like all the usual unicode symbols are already used for the existing things within the type system03/04 22:09
augur\all ~ forall etc etc03/04 22:09
augurinteresting!03/04 22:09
copumpkinthey aren't really reserved though03/04 22:09
copumpkinyou can usually use them in identifiers03/04 22:09
copumpkinjust don't put spaces around them03/04 22:09
auguri just mean that if you try to define, say, propositional universal quantification as \all : (A : Set) -> (B : A -> Set) -> Set it fails03/04 22:10
augurbecause \all is reserved for the usual type forall03/04 22:10
copumpkinoh sure03/04 22:11
copumpkinbut luckily the usual function arrow sort of has that signature03/04 22:11
copumpkinexcept  better03/04 22:11
augurno i know, im just going by the DTaW steps03/04 22:11
copumpkinah yeah03/04 22:11
augurcopumpkin: oh man03/04 22:17
augurthis little section about the sorting and insertion03/04 22:18
auguroh man03/04 22:18
auguri know its trivial, ok03/04 22:18
augurbut03/04 22:18
--- Day changed Mon Apr 04 2011
joe6xplat, ok, thanks.04/04 00:03
joe6has anyone seen this? http://www.cs.ru.nl/~wouters/Talks/BrouwerExtraction.pdf04/04 00:27
augurjoe6: watsi bout04/04 00:45
joe6talks about xmonad and coq04/04 03:07
joe6augur, talks about xmonad and coq04/04 03:07
--- Log closed Mon Apr 04 04:02:40 2011
--- Log opened Mon Apr 04 04:02:51 2011
-!- Irssi: #agda: Total of 39 nicks [0 ops, 0 halfops, 0 voices, 39 normal]04/04 04:02
-!- Irssi: Join to #agda was synced in 65 secs04/04 04:03
--- Log closed Mon Apr 04 10:04:50 2011
--- Log opened Mon Apr 04 10:05:19 2011
-!- Irssi: #agda: Total of 40 nicks [0 ops, 0 halfops, 0 voices, 40 normal]04/04 10:05
-!- Irssi: Join to #agda was synced in 68 secs04/04 10:06
xplatpumpkin: is there something you are waiting for me to do before you merge in the ⟨⊗⟩-ified Monoidal stuff or did you just not get around to it so far?04/04 17:43
pumpkinoh no, sorry, just haven't had any time at all for past week04/04 17:44
pumpkindo you need me to? I can push it04/04 17:44
pumpkinthere :)04/04 17:46
pumpkinhmm, I thought I'd actually deleted the big chunk of commented-out code04/04 17:46
pumpkinxplat: okay, pushed again04/04 17:50
augurpumpkin!04/04 17:57
pumpkinyo04/04 17:57
pumpkinhi :)04/04 18:06
augurok this time i found a real error in DTaW04/04 18:12
augurlol04/04 18:12
pumpkin?04/04 18:23
augurpumpkin: they use || when they only defined \/04/04 18:27
augurhm. this isnt parsing. odd04/04 18:27
pumpkinxplat: doing anything interesting CT-wise now?04/04 19:52
--- Day changed Tue Apr 05 2011
augurso how can i define something like Sigma (X : ClassicSet) (X * X -> Bool) ?05/04 07:19
augurim guessing this is going to involve some hidden proof of membership on the pair things?05/04 07:20
augurhm05/04 07:49
augurwhats wrong with this type:05/04 07:49
augurdata _*_ {T T2 : Set} : CSet T -> CSet T2 -> Set where05/04 07:49
augur  pair : {T T2 : Set} {A : CSet T} {B : CSet T2} -> (x : T) -> (y : T2) -> {p1 : x ∈ A} -> {p2 : y ∈ B} -> A * A05/04 07:49
augurthat should be A * B rather05/04 07:51
augurcopumpkin: can you link me to your CT source code?05/04 08:49
augurcopumpkin: i mean, ultimately i just want to get some idea of how to have both code that represents the mathematical objects in question, and also that can be executed, i suppose05/04 09:22
augurso i presume that your CT code is such that you have arrows and objects and some way of saying that this is some arrow and this is its definition05/04 09:23
auguras an agda function05/04 09:23
augurso i figure i could look at that and learn how to then be able to say stuff like digraphs are something like you'd expect -- (X, r : X*X -> Bool), sort of05/04 09:24
augurmeh.05/04 09:25
xplataugur: https://github.com/pumpkin/categories05/04 12:19
danrcopumpkin: xplat: is yoneda lemma hiding somewhere in categories in the Hom and Representable files?05/04 13:24
danr(or anywhere :) )05/04 13:25
copumpkinnot yet05/04 13:31
copumpkinsoon though, when I get soem time05/04 13:31
danrI'm trying to grok it, I was thinking maybe I should try to do this in Agda05/04 13:32
danrbut I fear I will get more stuck in types of great size and typechecking delays than if I just do it on paper05/04 13:32
copumpkinprobably true :)05/04 13:33
xplatthere definitely is some administrivia in Agda that there isn't on paper05/04 13:53
xplatlike all the uses of the 'preassoc' function in Monoidal to rebracket trinary and quaternary functors is something that's entirely glossed over on paper05/04 13:55
xplat(rebracket = stuff like take a functor on C × (D × E) to one on (C × D) × E )05/04 13:57
jlouisI am continuing my little development of the "Why dependent types matter" paper in Agda. I am stuck here: https://gist.github.com/e4afaf870f329e8f5811 where I can't get insertTT's implicit {n} put in correctly. How does one proceed?05/04 16:22
xplatjlouis: might need a space there?05/04 16:28
jlouisxplat: that is very possible05/04 16:30
danrtry this05/04 16:31
danrinsertTT {X} .{num p₁ + n + n} x (nodeT {n} p₁ l r) = ?05/04 16:31
SaizaninsertTT {X} x (nodeT {n} p₁ l r) = subst (DealTT X) (cong suc (plusSuc n _)) (nodeT p₀ l (insertTT x r))05/04 16:32
Saizan^^^ that works for me05/04 16:32
danreven simpler :)05/04 16:32
jlouisoh, of course!05/04 16:33
jlouisI forgot there was an implicit {n} on the nodeT05/04 16:33
jlouisthat will help, thanks05/04 16:33
augurxplat: denki05/04 17:38
auguris there a standard way of accessing the elements of a finite Set? or are those only accessible via their constructors?05/04 19:04
auguralso, how can i bring into emacs new latex packages for symbols?05/04 19:40
xplataugur: enumerating the elements of an arbitrary finite Set is not possible; the set theory implied on Set by Agda's type theory is intuitionistic05/04 20:01
augurxplat: ok.05/04 20:02
dolioWhat's a finite set?05/04 20:02
augurdolio: a set with finitely many elements?05/04 20:03
xplatso it's not decidable if a Set is finite, and if it is you can't necessarily list it with no repeats, and although finite sets have listings there could be 'subfinite' sets that are subsets of finite sets and do not05/04 20:03
augurxplat: mostly i was looking to be ablt to say, like.. data X : Set where x : X, y : X05/04 20:03
augurxplat: im really more just trying to figure out how to both reason about algebraic structures like graphs and also inspect them05/04 20:04
dolioWhat does the specification of "a set with finitely many elements" look like?05/04 20:04
xplataugur: once you've thought about dolio's question for a while, look at http://math.andrej.com/2009/09/07/constructive-stone-finite-sets/05/04 20:06
xplat(warning: spoilers!)05/04 20:07
danrxplat: I just took a quick look at your link, it seems pretty depressing (from a constructive view)05/04 20:12
xplatdanr: you can think of it positively: it is a nice collection of recipes for constructing decision procedures out of other decision procedures.05/04 20:14
augurxplat: is there a preferred way for making nice lagda code? like, the kind with all the pretty subscripts and so forth? or would that only show up in the latex render?05/04 20:19
xplataugur: you can use (some) subscripts, including numeric ones, in plain agda code.  you type \_0 or such.05/04 20:24
xplatunicode has a much more complete set of superscripts than subscripts so they are more commonly used for non-numbers05/04 20:25
xplat\^l and the like05/04 20:26
augurhm05/04 20:28
auguraha!05/04 20:28
augurawesome05/04 20:28
augurwhats the reason for making Rel indexed by level05/04 20:38
Saizana relation might quantify over stuff of higher universes05/04 20:44
xplat< for Set₀'s ordinals would be a good example if you could construct it :)05/04 21:00
Saizanyou can't?05/04 21:01
xplater, can you?05/04 21:01
xplatmaybe you can -- i guess Rels don't have to be decidable05/04 21:03
augurSaizan: hm05/04 21:06
augurwait, over higher universes??05/04 21:06
Saizanfor example, Leibniz : Set -> Set -> Set1; Leibniz A B = forall {F : Set -> Set} -> F A -> F B05/04 21:09
Saizansince (Set -> Set) : Set105/04 21:09
Saizando you know about universes? they are there to prevent russel's paradox, basically05/04 21:10
codolioWhy would < for ordinals require a higher universe?05/04 21:10
Saizani've defined it in Set, in fact05/04 21:12
xplatcodolio: because its domain is universe-sized05/04 21:25
xplati mean, you can define it as a predicate that doesn't talk about higher universes, but you need higher universes to talk about its graph05/04 21:25
codolioWhat's your ordinal definition?05/04 21:25
xplatmaybe i'm mixing up what Rel is in Agda since i really haven't used it yet05/04 21:27
codolioRel A i = A -> A -> Set i05/04 21:27
codolioI believe.05/04 21:27
xplatah, yes, that's the predicate form and the index wouldn't come into it for ordinal <05/04 21:29
xplat(at least that one wouldn't.  but wouldn't the type of Rel need to be Rel : {j : Level} {domain : Set j} -> Set <something>?05/04 21:34
codolioThere's an implicit index for A.05/04 21:34
xplater, wait: Rel : {j : Level} (A : Set j) (i : Level) -> Set (i \lub j)05/04 21:35
codolioPresumably that wasn't the issue.05/04 21:35
codolioThe second index was.05/04 21:35
xplat(er, Set (suc (i \lub j)) or however you write that ...)05/04 21:36
xplatoic05/04 21:36
xplatprobably talking agda when i feel lightheaded is not the best idea to begin with05/04 21:36
codolioAt least, I think wanting one Rel definition that works for relations over types in many universes is obviously nice.05/04 21:37
xplatdang allergies05/04 21:37
xplatyeah, the whole point of universe polymorphism is that you don't want to redefine everything for every universe05/04 21:38
codolioThat you'd want your 'proposition' universe to be unrelated is maybe less obvious.05/04 21:38
xplatah, yeah, i guess it is05/04 21:38
xplatin a way it seems like implementation details leaking out05/04 21:39
codolioYeah. You could probably avoid it if we had cumulativity.05/04 21:39
codolioRel : {i : Level} (A : Set i) -> Set i ; Rel {i} A = A -> A -> Set i05/04 21:40
codolioEr, the output should be Set (suc i).05/04 21:40
augurSaizan: oh, i see, i think05/04 21:40
codolioThen you pick a high-enough i for both your A and your propositions.05/04 21:40
auguralso, whats Leibniz?05/04 21:40
codolioLeibniz is the definition of equality in second/higher order logic, given by Leibniz.05/04 21:42
xplatit's basically equality by substitutability05/04 21:43
codolioTwo things are equal if all predicates agree on them.05/04 21:43
xplatwhen you interpret it in first-order set theory it comes out as 'two things are equal if they are in all the same sets'05/04 21:44
augurahh yes ok05/04 21:45
xplatwhich, since it's a definition, gives a kind of interesting spin on the axiom of extensionality05/04 21:45
xplat(well, technically liebniz equality on sets comes out to 'they have the same elements and are in the same sets', but in the AoE you really only conclude the latter because the former is true by assumption)05/04 21:47
djahandarieHm, how would I talk about the concept of structural induction in the type level?05/04 22:50
djahandarieHaving a formal definition of structural induction would probably help me here05/04 22:50
* djahandarie looks05/04 22:50
djahandarieOh right, ezyang wrote something about this. Maybe it has what I'm looking for05/04 22:51
augurwhy am i getting parsing errors with soemthing like f _~_ = .. x ~ y ... ?05/04 23:15
augurand why am i getting yellow backgrounds on code that comes from the agda people :|05/04 23:16
augurwell, my transcription of said code but05/04 23:16
djahandarieIf it's old enough I suppose it's possible that stuff has changed quite a bit in the compiler.05/04 23:16
augurits no older that 200705/04 23:17
djahandarieAgda is still in the "avoid success at all costs" stage, after all ;)05/04 23:17
augur:P05/04 23:17
djahandarieI dunno. Maybe paste the code and someone would know05/04 23:18
augurwell just like05/04 23:18
augurRel : ∀ {a} → Set a → (ℓ : Level) → Set (a ⊔ suc ℓ)05/04 23:18
augurRel A ℓ = REL A A ℓ05/04 23:18
augurgives me an error on the second A in REL A A \ell05/04 23:18
augur(assuming the definition05/04 23:18
augurREL : ∀ {a b} → Set a → Set b → (ℓ : Level) → Set (a ⊔ b ⊔ suc ℓ)05/04 23:18
augurREL A B ℓ = A → B → Set ℓ05/04 23:18
augurbut if i do Rel A \ell = A \to A \to Set \ell05/04 23:18
augurthen its fine05/04 23:19
Saizanwhat's the error?05/04 23:20
auguryellow background on the second A in REL A A \ell05/04 23:21
augurmind you, im just getting this from danielsson's Agda standard lib05/04 23:41
xplatit can't choose which level to have the second arg of REL at i guess05/04 23:52
xplatwhich is ... weird.  it should be able to, i think.05/04 23:52
augureven if i stick to level 0 and level 1 sets it still wont work05/04 23:55
augurREL : Set → Set → Set105/04 23:56
augurREL A B = A -> B -> Set05/04 23:56
augurRel : Set → Set105/04 23:56
augurRel A = A → A → Set05/04 23:56
augurReflexive : ∀ {A : Set} → Rel A → Set05/04 23:56
augurReflexive p = ∀ {x} → p x x05/04 23:56
auguryields a yellow hghlight and underline on the second x05/04 23:56
auguro_05/04 23:56
auguro_O05/04 23:56
--- Day changed Wed Apr 06 2011
auguralso what are the fixity levels??06/04 00:18
auguroh, the highlighting was just an aquamacs error it seems06/04 00:21
copumpkinoh shit, I forgot to retypecheck after changing monoidal and helpers06/04 02:29
copumpkinand now when I'm loading cartesian it's taking 2 gigs of ram06/04 02:29
xplat:(06/04 02:32
xplati wish i knew why it uses that much06/04 02:33
xplati mean, it's complex, but not THAT complex, i would think ...06/04 02:34
copumpkinyeah06/04 02:35
copumpkinwe need someone seriously dedicated to spend a summer profiling it06/04 02:35
copumpkinif only we had a good student who was interested06/04 02:36
augurcopumpkin: lolwut06/04 02:36
augurwhat are you doing that its this serious?06/04 02:36
copumpkin?06/04 02:37
augurwell, it sounds like whatever you're doing is a serious endeavor not just idle tinkering06/04 02:39
copumpkinoh06/04 02:48
copumpkinjust tinkering with category theory in agda06/04 02:49
copumpkinnothing too serious06/04 02:49
djahandarieSerious tinkering06/04 02:49
djahandarieIt sometimes switches to an idle endeavor06/04 02:49
djahandarieI am fairly interesting in trying to make Agda run faster, but I don't know the code at all and may not be good enough to get serious improvements.06/04 02:51
augurcopumpkin: how does this error make any sense06/04 03:02
augurn != n of type Level when checking that the expression X has type Set n06/04 03:02
copumpkinlet's see the rest06/04 03:03
augurthats all of it!06/04 03:03
augurthe whole error, i mean06/04 03:03
copumpkinI mean the code :P06/04 03:03
auguro ok06/04 03:03
copumpkinbut yeah, it makes no sense06/04 03:03
auguris there an agda paste place?06/04 03:03
copumpkinagda makes some bad decisions about naming sometimes06/04 03:03
copumpkinI just use hpaste06/04 03:03
augurhttp://hpaste.org/45348/herp_derp06/04 03:05
augurhm. it seems \T6 is Big triangle not merely a triangle06/04 03:05
copumpkinwhich bit fails?06/04 03:06
* copumpkin ponders using "type annotations" in agda for this code06/04 03:19
augurcopumpkin: type annotations?06/04 03:29
auguralso, the bit that says Digraph {n} X06/04 03:29
augurX gives a red highlight06/04 03:29
copumpkinoh06/04 03:30
copumpkinyou can't do that06/04 03:30
copumpkinyou bound {n} in the data header and in the constructor06/04 03:31
copumpkinjust take out the \forall {n} in the constructor06/04 03:31
copumpkinthat'd make it some weird sort of Set_omega constructor06/04 03:31
augurmm..06/04 03:37
augurthe idea is that Digraph is just a wrapper for Rels, right06/04 03:38
augurbut without an overt level argument06/04 03:38
augurand with a constructor06/04 03:38
augurbut i cant make it work :(06/04 03:38
copumpkinyeah, you just don't want the \forall level on the constructor06/04 03:38
augurcopumpkin: i dont know what the type definition should be at all :(06/04 03:43
copumpkinhttp://hpaste.org/paste/45348/herp_derp_annotation#p4534906/04 03:44
copumpkin(untested, obviously)06/04 03:44
augurs'what i have now but its giving me a type error06/04 03:45
augurn ⊔ level-suc n != n of type Level when checking the constructor digraph in the declaration of Digraph06/04 03:45
copumpkinxplat: I'm copying your awesome three-star symbol06/04 04:24
copumpkinit shall hitherto be known as the xplat06/04 04:24
copumpkinhitherfrom?06/04 04:24
copumpkinhitherto is definitely wrong06/04 04:25
dolioHenceforth.06/04 04:27
copumpkinyes!06/04 04:30
copumpkinthank you06/04 04:30
copumpkinthat's what I was looking for06/04 04:30
* copumpkin eats some corn nuts while waiting for his agda to typecheck06/04 04:31
copumpkinxplat: product just got a hell of a lot of handy helper functions06/04 05:50
copumpkinthe product object, that is06/04 05:50
copumpkinif we showed that category.product was a product in the category of categories, it'd avoid duplicating stuff like that06/04 05:50
copumpkinunfortunately I accidentally convinced agda to rebuild all the monoidal stuff for me again06/04 05:52
copumpkinoh actually06/04 05:53
augurcopumpkin: :\06/04 06:00
copumpkinyo06/04 06:00
augurcopumpkin! help me figure this out! :(06/04 07:12
copumpkinmove it one universe up?06/04 07:12
augurwhat?06/04 07:13
copumpkinif it doesn't fit, move the datatype one universe level up?06/04 07:13
augurits not that it doesnt fit, i dont think06/04 07:13
augurits that it doesnt type check at all06/04 07:13
copumpkinhm06/04 07:13
augurand i dont know how06/04 07:13
augurthe code you gave was what i had for a while06/04 07:13
augurand it just gives an error06/04 07:13
copumpkindata Digraph {n} (X : Set n) : Set (n ⊔ level-suc n) where06/04 07:15
copumpkin  digraph : Rel X n → Digraph {n} X06/04 07:15
copumpkinit's really basically isomorphic to Rel06/04 07:15
copumpkinso it'd make sense that it'd live in the same universe06/04 07:15
copumpkinof course, it seems like you should be able to prove n \lub suc n is just suc n06/04 07:16
copumpkinbut I guess not06/04 07:16
augurthat works, but now i get yellow highlights on the Rel's in the four propositions06/04 07:16
augurno five06/04 07:16
augurall but irreflexive06/04 07:16
auguro_06/04 07:16
auguro_O06/04 07:16
copumpkinyour Xs need annotations06/04 07:16
copumpkinthere's nothing tying them to the \ell you type for the level06/04 07:17
copumpkin\all {\ell} {X : Set \ell}06/04 07:17
augurwhat06/04 07:17
copumpkinoh fine, you need another universe for X06/04 07:17
auguroh oh sorry06/04 07:17
copumpkinmisread06/04 07:17
augurits so weird06/04 07:19
augurcause like06/04 07:19
augurim basically lifting code from danielsson06/04 07:20
auguri also dont know how these levels should work06/04 07:21
augurlike06/04 07:22
augurwhat should the type of these propositions be06/04 07:22
auguri dont know whats sensible06/04 07:22
augurcause Rel X l is of level succ l06/04 07:22
augurdoes that matter?06/04 07:23
copumpkinnot really06/04 07:25
copumpkinjust use whatever universe it fits in06/04 07:25
auguri feel uncomfortable not understanding what and why :(06/04 07:28
augurhmm06/04 17:13
auguris there a way to say like.. theres a property that holds of relations, call it P06/04 17:13
augurand P holds of the constantly false relation?06/04 17:13
Saizan(P : Rel X l -> Set) -> P (\ _ _ -> false) -> ... ?06/04 17:14
Saizanchanging false with your name for the empty type, i guess, and possibly allowing Set l1 as the range of P06/04 17:15
augureh, but its propositional relations, right, so their types are X -> Y -> Set n06/04 17:15
augurhm..06/04 17:16
auguri could try doing it with lambdas. i used const False but that didnt work, it gave a parse error06/04 17:16
Saizanuse (X -> Y -> Set n) as the domain of P then06/04 17:16
augurlemme try the lambda approach06/04 17:16
auguraha! that works!06/04 17:16
auguroh, no, it doesnt06/04 17:17
augurit parses but its not a valid pattern06/04 17:17
SaizanP (const (const False)) should work06/04 17:17
Saizananyhow, it's better if you paste the code with the error06/04 17:17
augurwell right now its _just_ a parse error06/04 17:19
auguractually im aiming for a proof object sorry, not the proposition06/04 17:19
augureh..06/04 17:21
augurhrmph06/04 17:21
augurSaizan: http://hpaste.org/45369/agda_q06/04 17:24
augurim aiming to have a base proof object for the proposition LinearOrder (digraph (const \bot))06/04 17:24
Saizan(const \bot) is not a valid Rel, because it takes 1 argument, not 206/04 17:26
Saizan(\ _ _ -> \bot) would be06/04 17:27
augurehh true enough06/04 18:05
augurhmm06/04 18:05
auguryeah06/04 18:05
augurhmm06/04 18:05
augurhmmm06/04 18:05
augurbut then why wouldnt const parse at all06/04 18:06
Saizancan you paste the code which gives the parsing error?06/04 18:07
augurits just like06/04 18:08
augurˇ06/04 18:08
augur..06/04 18:08
augurlinear-unit (const2 ⊥) = ⊤06/04 18:08
augurif i do \ _ _ -> \bot that works, right06/04 18:08
augurbut const2 \bot doesnt06/04 18:08
augurif i do \_ _ -> \bot i get a pattern error06/04 18:08
Saizanlooks like you're trying to pattern match there?06/04 18:09
Saizanaside from "dot patterns" you can only pattern match on constructors06/04 18:09
auguryeah, well, i mean, the intention is to have an object that is a proof that const2 \bot : One -> One -> Set n is a linear order06/04 18:10
auguror well, the digraph consisting of that06/04 18:10
Saizanstop meaning and show instead :)06/04 18:10
auguri dont know what to show!06/04 18:10
auguri dont have to show!06/04 18:10
augurwhat i pasted is where i stopped06/04 18:11
Saizanthat linear-unit doesn't have a type signature above it?06/04 18:11
auguri dont know quite how to proceed, and the linear-unit thing there was my first guess06/04 18:11
augurtho its certainly wrong06/04 18:11
augurno it does -- (dgu : Digraph One) -> LinearOrder dgu06/04 18:11
augurbut im not concerned with linear-unit as such06/04 18:12
auguri just need to figure out how to state that this thing is a proof that digraph (const2 \bot) is a linear order over One06/04 18:13
Saizana proof that  const2 \bot is a linear order should have type "LinearOrder (digraph (const2 \bot))"06/04 18:13
augurwhat thing, well, who knows!06/04 18:13
augurhm.. true true.. hmm06/04 18:14
augurhmm hmm06/04 18:14
Saizan"LinearOrder {X = One} (digraph (const2 \bot))" to be precise06/04 18:14
augurSaizan: <306/04 18:21
augurhmm06/04 18:30
augurshould i be treating propositional implication as a function or as its own type? :\06/04 18:30
auguror, well, a type operator06/04 18:31
augurcause the way i have transitivity defined its Transitive _~_ = ∀ {x y z} → (x ~ y) ∧ (y ~ z) → x ~ z06/04 18:32
augurbut if y ~ z is \bot, the whole implication is true06/04 18:32
auguror should be06/04 18:32
Saizanand that's how it works with that type06/04 18:33
augurbut then whats an inhabitant of such a thing?06/04 18:34
Saizanof Transitive someRel ? a function06/04 18:34
augurTransitive (const2 False) = forall {x y z} -> (const2 False x y) & (const2 False y z) -> (const2 False x z)06/04 18:34
Saizanyes06/04 18:35
augurbut what sort of function is that? it shouldnt have any inhabitants should it? or shouldnt it?06/04 18:35
augurcause that should be just False & False -> False06/04 18:35
Saizan"foo : Transitive (const2 False); foo (conj () _)"06/04 18:35
augurhm..06/04 18:36
Saizanwith () you're saying "the type of this thing is empty! i refuse to go further down this path!"06/04 18:36
augurhuh!06/04 18:37
auguri have a hard time wrapping my head around the use of these empty things06/04 18:37
augurSaizan: <306/04 18:38
Saizanyou might expect that such a function should simply have no definition, since its graph in set theory would be empty too, but spelling that fact out like in foo above makes some things decidable that otherwise wouldn't06/04 18:40
augurya06/04 18:40
Saizanthose things being converting from pattern matching and recursion to structural induction06/04 18:41
augurwell, an empty graph is definable, surely06/04 18:41
auguri just dont think in the programs-as-proofs terms quite naturally yet06/04 18:41
augurso06/04 18:41
augurso then why cant i define something of type A -> False06/04 19:56
augur:|06/04 19:56
auguroh, well, i guess there shouldnt be any inhabitants at all?06/04 19:57
augurif i do f : (True -> False) -> True ; f ()06/04 19:58
auguri get the error that it isnt obvious that True -> False is empty06/04 19:58
augurthat is to say, i have no idea what an inhabitant of \neg A should be :(06/04 19:59
augurif \neg A = A -> False06/04 19:59
augurf : \neg A ~ f : A -> False ; f = ...?06/04 19:59
Saizanyou can do f x = False-elim (x _)06/04 19:59
augurhmm06/04 19:59
Saizanwhere False-elim : False -> forall {A} -> A06/04 20:00
augurhmm!06/04 20:00
Saizanand inhabitant of \neg A is a function that produces a proof of False out of a proof of A06/04 20:01
augurright06/04 20:03
augurhm06/04 20:04
augurreally tho the issue is that i need to have a proof ~ A & B06/04 20:05
auguri mean, even just a proof f : ~ A!06/04 20:06
augurits so much easier on the value-level06/04 20:10
augur:\06/04 20:10
augurat least there i know how to negate something!06/04 20:10
augurhmm but wait06/04 20:17
augurif P = False06/04 20:17
augurthen ~ P = False -> False06/04 20:17
augurwhich is just id!06/04 20:17
copumpkinyeah, that's good, right?06/04 20:24
copumpkinFalse -> False is inhabited06/04 20:24
copumpkinso not false = true06/04 20:24
auguryeah, its just hard to see how ~ False == True, tho i guess its not True as such, but something else, that is not merely False06/04 20:29
augurhence false-id06/04 20:29
augurbut06/04 20:29
copumpkintrue is anything that is inhabited06/04 20:29
auguri know06/04 20:30
augurbut True is ~ Unit!06/04 20:31
xplatTrue is a sort of 'final truth'06/04 20:39
xplatthat is, it's a true statement that can be proved from any other true statement in a unique way06/04 20:39
augursure sure06/04 20:40
xplatdata True : Set where Duh : True06/04 20:40
augurnow im stuck figuring out how to show that inr (conj ⊥-id (inr (conj ⊥-id (refl *)))) : ∀ {x y} → (¬ (const2 ⊥ x y) ∧ (_ ∨ (¬ (const2 ⊥ y x) ∧ (x == y))))06/04 20:41
xplatthe what now?06/04 20:41
auguractually sorry06/04 20:41
augurtheres some junk missing cause i was whittling it down as i was constructing the inhabitant lol06/04 20:42
augurf : ∀ {X} {x y} → X ∨ (¬ (const2 ⊥ x y) ∧ (X ∨ ¬ (const2 ⊥ y x) ∧ x == y))06/04 20:42
augurf = inr (conj ⊥-id (inr (conj ⊥-id (refl *))))06/04 20:42
augurthis type checks by itself06/04 20:42
copumpkinxplat: I have a lot more of cartesian done now. I can probably finish it tonight!06/04 20:42
augurwait wait wait06/04 20:43
augurwhat the hell06/04 20:43
* copumpkin waits waits waits06/04 20:44
auguri think i need to clear the type check buffer or whatever its called06/04 20:44
auguri have two identical expressions, that differ only in the function name06/04 20:44
augurone checks the other doesnt06/04 20:44
copumpkinthere could be other constraints on one that aren't on the other?06/04 20:45
augurstill nothing!06/04 20:45
copumpkinfrom some other function06/04 20:45
augurno no, they're the SAME expression06/04 20:45
augurtrich-unit : Trichotomous {X = One} (const2 ⊥)06/04 20:45
augurtrich-unit = inr (conj ⊥-id (inr (conj ⊥-id (refl *))))06/04 20:45
augurtrich-uni2 : Trichotomous {X = One} (const2 ⊥)06/04 20:45
augurtrich-uni2 = inr (conj ⊥-id (inr (conj ⊥-id (refl *))))06/04 20:45
auguroh oh but the failure of the first might be blocking checking of the second06/04 20:45
augurno?06/04 20:45
auguryeah06/04 20:46
xplatyou might have confused agda-mode by editing outside holes.  C-c C-l?06/04 20:46
auguri dont know how to use holes :(06/04 20:46
copumpkinpaste the code06/04 20:46
Saizanit reports only the first error in a file06/04 20:46
xplatholes are easy.  you write a ? anywhere you might want an expression.  it becomes a hole.06/04 20:46
xplat(that is, it becomes a hole when you load with C-c C-l, or a ? inside a hole becomes a hole when you 'give' with C-c C-SPC06/04 20:47
xplat)06/04 20:48
auguraha06/04 20:48
xplatholes are also called 'goals' or occasionally 'barns'06/04 20:48
Saizansheds even06/04 20:48
xplater, right, sheds06/04 20:49
auguri think its failing on f : \all {x y : One} -> x == y ; f = refl *06/04 20:49
xplatanyway, it's a feature i really wish i could use in haskell ...06/04 20:49
auguri dont know how to expand a goal :(06/04 20:50
xplatyou either type a candidate expression (possibly with goals of its own) inside the goal and 'give' (C-c C-SPC)06/04 20:51
augurhm06/04 20:51
xplator you could use C-c C-r to 'refine' based on the type of the goal06/04 20:51
auguri just get an incomplete pattern match error :(06/04 20:52
xplator you could type the name of a function and C-c C-r to refine based on that function (creates an application of that function with goals for all the arguments)06/04 20:52
xplator type some identifiers and flags in the goal and hit C-c C-a to try to automatically find an inhabitant06/04 20:53
xplatby stringing those identifiers together06/04 20:54
xplatthe flag '-m' stands for 'all identifiers in scope'06/04 20:54
augurok so first, in aquamacs, C-c C-r does nothing for me06/04 20:55
xplatnothing, or an error message?06/04 20:55
augurerll, i get errors, really06/04 20:56
augurbah, i dont know what im doing with this goal thing06/04 20:56
auguralso, whats this automatically finding an inhabitant06/04 20:56
augurhow does that work06/04 20:56
xplatthe goal thing is worth sticking to06/04 20:56
xplataugur: there's a program similar* to djinn that tries to create an inhabitant for a type by combining together values that you give it06/04 20:57
xplat(*actually internally it's pretty different, but the function is similar)06/04 20:58
augurok, we'll talk more in about an hour and a half06/04 20:58
augurbrb06/04 20:58
auguroh hello06/04 22:16
auguractually no hello, i have to leave :p06/04 22:16
augurbye06/04 22:16
copumpkinhttp://hpaste.org/45392/from_this06/04 23:46
copumpkinhttp://hpaste.org/45393/to_this06/04 23:46
copumpkinI kind of prefer the latter06/04 23:46
copumpkindon't you?06/04 23:46
Saizanoh, really?06/04 23:46
Saizanthe former could find a place in some contemporary art gallery06/04 23:47
Saizancopumpkin: how did you manage the transformation?06/04 23:55
--- Day changed Thu Apr 07 2011
copumpkinby hand07/04 00:13
copumpkinand by writing some nice helper functions :)07/04 00:13
copumpkiniterative transformations, that is07/04 00:13
copumpkinanyway, that's the pentagon law for cartesian07/04 00:14
Saizanah, so the normal form would still be printed like above?07/04 00:14
Saizani thought you found a way to make it stop printing module names when they aren't needed :)07/04 00:15
copumpkinoh no, I wish07/04 00:19
copumpkinyeah, the normal form is horrifying07/04 00:19
copumpkinI just try to pretend it doesn't exist and follow what I feel it should be07/04 00:19
copumpkinso what's a monoid object in a cartesian category?07/04 00:27
* Saizan doesn't even know what a cartesian category is07/04 00:32
copumpkinit's a monoidal category whose monoidal behavior comes from products and a terminal object07/04 00:40
copumpkincartesian closed is one of those that's also closed07/04 00:40
Saizanah, ok, so it doesn't necessarily have all products, but they still associate and have an identity07/04 00:42
djahandarieIs a cartesian category the same thing as a cartesian monodial category?07/04 00:42
copumpkinyeah, cartesian monoidal07/04 00:42
copumpkinSaizan: it should have all finite products if it has binary products and terminal, right?07/04 00:42
Saizancopumpkin: is A x B guaranteed to exist for every A and B?07/04 00:43
copumpkinI was going to make a generalization of binary products to show that actually07/04 00:43
copumpkinSaizan: well, in my library I separate those cases07/04 00:43
copumpkinyou can have _a_ product, which is an object that satisfies the product diagram for two other objects07/04 00:44
copumpkinI also have a record saying that you have all binary products07/04 00:44
copumpkinmeaning forall objects A and B, you can get one of the first thing07/04 00:44
copumpkinand you get a hell of a lot of convenience methods with that07/04 00:44
copumpkinfirst, second, ***, etc.07/04 00:44
copumpkinand proofs about them, of course07/04 00:44
Saizanah, the monoidal product is a functor C x C -> C, so you do have all of them07/04 00:45
Saizanso closed just adds the infinite ones, i.e. exponentials07/04 00:46
copumpkinyeah, I guess07/04 01:02
copumpkinclosed seems really close to exponentials, but nothing I've seen mentions that they're essentially connected concepts07/04 01:02
copumpkinwell, wikipedia or ncatlab :P07/04 01:02
copumpkinI wonder why07/04 01:02
augurheyo07/04 01:10
augurxplat: whats this djinn function now?07/04 01:10
auguror djinn program07/04 01:10
codolioA closed category uses the same definition as having all exponentials, except it uses an arbitrary tensor product instead of the categorical product.07/04 01:18
djahandarie@djinn (a, b) -> b07/04 01:18
lambdabotf (_, a) = a07/04 01:18
djahandarie@djinn b -> (a -> b) -> Maybe a -> b07/04 01:18
lambdabotf a b c =07/04 01:18
lambdabot    case c of07/04 01:18
lambdabot    Nothing -> a07/04 01:18
lambdabot    Just d -> b d07/04 01:18
djahandarie@djinn Not (Not (((a->b)->a)->a))07/04 01:19
lambdabotf a =07/04 01:19
lambdabot    void (a (\ b -> void (a (\ _ -> b (\ c -> void (a (\ _ -> c)))))))07/04 01:19
augurhow does djinn work?07/04 01:20
djahandarieIt reads a type as a logic formula, then decides it with the LJT sequent calculus.07/04 01:21
augurhm07/04 01:22
augurwait, LJT?07/04 01:23
djahandarieSome variant of LJ, I don't remember the details though07/04 01:23
xplatcopumpkin: i prefer 45393 oh so much.  how did you even get the other one?!07/04 01:24
augurhm. is there source for djinn?07/04 01:24
djahandarieYeah, on augustss's site somewhere07/04 01:24
codolioIt's designed to have an easier completeness proof, I believe.07/04 01:25
codolioThat's the motivation for the differences, anyway.07/04 01:25
codolioI think the author calls its proof structurally inductive, but it's not so structurally inductive that you'd get Agda to accept it immediately.07/04 01:27
copumpkinxplat: ?07/04 01:33
copumpkinoh07/04 01:33
copumpkinxplat: that's the fully normalized form of the pentagon law for cartesian monoidal07/04 01:33
copumpkinthe other one is fully denormalized07/04 01:33
copumpkinwell, as denormalized as I feel like making it07/04 01:34
xplatah07/04 01:34
xplati obviously should have also invented first and second so i could write the pentagon like that07/04 01:34
copumpkinI should probably break https://github.com/pumpkin/categories/blob/ba5bcf4ccf04ecb417eca651bd8757cc4b8830ba/Category/Object/Product.agda#L329 out from Product07/04 01:36
copumpkinlots of convenience stuf07/04 01:36
copumpkinmade my life way easier for cartesian07/04 01:36
xplatyeah, i'll bet07/04 01:43
augur:(07/04 02:55
augurhow can i prove \all {x y : One} -> x == y07/04 02:55
augurtheres only one inhabitant of One, but it doesnt seem to be the case that refl * is an inhabitant, so.. :\07/04 02:56
augureh. should this be a function?07/04 02:57
auguri never know with these damn covert arguments07/04 02:57
augur(x y : One) -> x == y is just \ * * -> refl *07/04 02:57
augurbut {x y : One} -> x == y ??07/04 02:57
augurp : (x y : One) -> x == y ; p * * = refl *07/04 02:59
augurchecks07/04 02:59
augurbut if its covert, and i eliminate the * args07/04 02:59
augurit fails07/04 02:59
augursaying * != .x of type One when checking that the expression refl * has type .x == .y07/04 02:59
codolioHow is One defined?07/04 03:04
xplatp : {x y : One} ; p {*} {*} = refl *07/04 03:07
xplater, p : {x y : One} -> x == y ; p {*} {*} = refl *07/04 03:08
copumpkinaugu: yeah, unless you make One a record07/04 03:23
copumpkinoh damn, he's gone07/04 03:23
copumpkin@tell augur you should make One a record, then it'll do what you want07/04 03:24
lambdabotConsider it noted.07/04 03:24
copumpkinaugur07/04 03:27
augurcopumpkin07/04 03:28
lambdabotaugur: You have 1 new message. '/msg lambdabot @messages' to read it.07/04 03:28
augurok!07/04 03:28
auguri get the feeling i should make almost everything a record07/04 03:28
augurlol07/04 03:28
copumpkinif it only has one constructor and doesn't refine indices, you might as well07/04 03:29
augurcopumpkin: still doesnt work :(07/04 04:05
auguroh wait!07/04 04:06
augurit does!07/04 04:06
augur:D07/04 04:06
augurnow to figure out how to make an instance of Trichotomous (const2 \bot)07/04 04:10
augurwoo!07/04 04:29
augurhmm07/04 04:45
augursee now im getting07/04 04:49
augur⊥ ∧ ⊥ → ⊥ != {x y z : One} → const2 ⊥ x y ∧ const2 ⊥ y z → const2 ⊥ x z because one is an implicit function type and the other is an explicit function type when checking that the expression conj trans-unit trich-unit has type Transitive (const2 ⊥) ∧ Trichotomous (const2 ⊥)07/04 04:49
lispythe last time I tried to learn me some agda, I found that the documentation and tutorials were out of sync with the language.  Has this been fixed yet?07/04 05:19
dolioI doubt there'd be much issue with what I used to learn.07/04 05:20
copumpkinlispy: I doubt it07/04 05:20
copumpkinlispy: they were minor differences, as far as I remember?07/04 05:20
lispydolio: well, the tutorials (even some very recently released) were not compiling.07/04 05:20
copumpkinagda changes a lot :P07/04 05:21
lispycopumpkin: It didn't feel minor.  Basic examples failed07/04 05:21
copumpkininstall one of the old hackage versions if you want it to work with that older stuff07/04 05:21
copumpkinyeah, but they failed for trivial reasons like not using universe polymorphism07/04 05:21
dolioThe tutorial I used had questions.07/04 05:21
dolioAnd very basic sample code, I guess.07/04 05:21
dolioBut it was mostly problems.07/04 05:21
copumpkinlispy: the main language difference since the main tutorial was written is universe polymorphism, which means forall {X} where X is a set will be yellow07/04 05:22
copumpkinit'll still compile07/04 05:22
copumpkinotherwise I can't think of anything too fundamental that's changed that would break old code07/04 05:22
* copumpkin shrugs07/04 05:23
lispyIt would be nice if someone updated it.  You can't expect beginners to know how to change the example code to make it compile when reading intro tutorials :)07/04 05:24
copumpkinthere's a shortage of manpower in agdaland :P07/04 05:25
copumpkinmore than even there is in GHCland07/04 05:25
lispyEvery open source project seems to say that :)07/04 05:25
lispySo, should I install from darcs or hackage?07/04 05:29
lispymaybe 2.2.10?07/04 05:29
dolioUniverse polymorphism isn't on by default.07/04 05:51
copumpkindolio: it still fails to infer forall {X} I think?07/04 05:54
copumpkinit just won't let you write level parameters07/04 05:54
dolioDepends how it's used.07/04 05:54
copumpkin(where X is a sort)07/04 05:54
copumpkinah07/04 05:54
dolioUniverse polymorphism isn't really relevant, though.07/04 05:54
copumpkinsomething like forall {X} -> X -> X07/04 05:54
lispyI guess my request is for Ulf to update his tutorials to support what agda actually supports instead of some previous version of the language07/04 05:59
Eduard_Munteanuo/07/04 13:23
Eduard_MunteanuHm, is there a way to get standard Agda libs with cabal? They don't seem to be included in the hackage distribution07/04 13:26
wharrrgarblno07/04 13:26
Eduard_MunteanuI see. Then I suppose I should download them separately.07/04 13:27
Eduard_MunteanuIs there anything like 'derive' from Haskell? I'm looking for something like Show.07/04 13:46
Eduard_Munteanu*deriving07/04 13:47
Saizanno07/04 13:48
Eduard_MunteanuHrm, or maybe I should ask about typeclasses, does Agda have them? :/07/04 13:48
Eduard_MunteanuBy looking at the sources in the stdlib, it doesn't seem like it.07/04 13:49
Saizanno, just records used as ML functors :)07/04 13:49
Saizananyhow, the repl doesn't need Show instances07/04 13:49
Eduard_MunteanuUh, this is going to be tough.07/04 13:49
Eduard_MunteanuWhat do you mean by 'repl'?07/04 13:49
Eduard_MunteanuI'm trying to write a simple main to putStrLn my list :)07/04 13:50
Eduard_Munteanu(dependently-typed one)07/04 13:50
Saizani mean agda --interactive if you've installed agda-executable, or the various function of the emacs mode07/04 13:54
Saizan*fucntions07/04 13:55
Eduard_MunteanuAh, thanks, lemme try that...07/04 13:55
Eduard_MunteanuYeah, that seems to work.07/04 13:56
Eduard_MunteanuBut how about if I want to write some programs and turn them into executables?07/04 13:57
Eduard_MunteanuI suppose I could hack up a simple show myself.07/04 13:57
Saizanyep07/04 13:59
Eduard_MunteanuAww, this is going to be a problem, since I kinda need to 'show' the underlying polymorphic type of the list.07/04 14:12
Eduard_MunteanuWhat's the normal type of 'main'?07/04 15:04
Eduard_Munteanumain : IO ⊤    doesn't seem to work :/07/04 15:04
* Eduard_Munteanu tries something polymorphic...07/04 15:05
Eduard_MunteanuNah.07/04 15:06
Eduard_MunteanuAre there any examples of doing IO with the standard lib?07/04 15:07
Saizanhave you used IO.run?07/04 15:08
Eduard_MunteanuI tried that too.07/04 15:08
Eduard_Munteanumain : IO ⊤    main = run (putStrLn (show ("a" :+: "b" :+: "c" :+: [])))07/04 15:09
Eduard_MunteanuI get ".IO.Primitive.IO ⊤ !=< IO ⊤ of type Set"07/04 15:10
Eduard_MunteanuThe trouble is, it checks without run, but it doesn't compile.07/04 15:10
Eduard_Munteanu(to an executable)07/04 15:10
Eduard_MunteanuWithout 'run', it says: The type of main should be .IO.Primitive.IO A, for some A. The given type is .IO.IO .Data.Unit.⊤07/04 15:12
Saizanyou've to use run and a different type signature for main07/04 15:13
Eduard_MunteanuI also tried IO Unit with 'run', didn't work either.07/04 15:13
Saizanimport IO.Primitive as Prim07/04 15:13
Saizanmain : Prim.IO ⊤07/04 15:13
Saizandifferent IO not different A :)07/04 15:13
Eduard_MunteanuAh, lemme try...07/04 15:14
Eduard_MunteanuThanks, it seems to compile now (a lot). It's a bit strange I have to use that Prim stuff.07/04 15:16
Saizanthe Prim stuff is haskell's IO imported through FFI, the other IO is defined in agda07/04 15:23
Eduard_MunteanuSaizan: I see. Is there any way I can use only the Agda stuff? Seems strange to mix those.07/04 15:23
Eduard_Munteanulike, just do   open import IO public07/04 15:24
SaizanIO doesn't export IO.Primitive, but you could omit the type signature on main, maybe07/04 15:24
Eduard_MunteanuOh.07/04 15:25
Eduard_MunteanuYeah, that works too.07/04 15:26
Eduard_Munteanu< Saizan> no, just records used as ML functors :)07/04 15:28
Eduard_MunteanuHrm, but can I use 'show' polymorphically?07/04 15:29
Saizanthere are various ways to use a Show A record, if you have opened the Show module you can say "show yourShowDict" or you can "open Show yourShowDict" then "show" will refer to that particular instance, so to speak07/04 15:32
Saizanthere's also a recent proposal to make it figure out the dictionary automatically07/04 15:36
Saizanhttp://comments.gmane.org/gmane.comp.lang.agda/272507/04 15:37
stevan(BTW, Dominique is working on merging it into the the main branch of Agda here at AIM :-)07/04 15:44
Saizan(cool :)07/04 15:44
Eduard_MunteanuThanks.07/04 15:44
Eduard_MunteanuHm, so I probably can't use that show on a polymorphic variable :/07/04 16:14
Saizanhow is your list defined?07/04 16:41
Eduard_MunteanuSaizan: data List (a : Set) : ℕ -> Set where   [] : List a zero    _:+:_ : ∀ {n} -> a -> List a n -> List a (suc n)07/04 17:04
wharrrgarblthat's an interesting cons you have there07/04 17:04
wharrrgarblwhy not ::?07/04 17:04
wharrrgarblnot that it matters at all :P07/04 17:04
Eduard_MunteanuAh, wanted to avoid potential conflicts :)07/04 17:04
wharrrgarbloh, agda lets you have conflicting constructors07/04 17:05
Eduard_MunteanuNice, so it distingushes them by types.07/04 17:05
wharrrgarblyeah07/04 17:05
djahandarieOh yeah, AIM is going on right now huh07/04 17:49
* djahandarie teleports to Gothenburg07/04 17:49
SnufsenOh right, that's now!07/04 17:50
SnufsenWell, not NOW now07/04 17:51
djahandarieJust ended or so?07/04 17:51
dantenfor today07/04 17:52
djahandarieRight07/04 17:52
dantenit will all end on tueday07/04 17:52
Eduard_MunteanuI wonder, is it possible to write a   length : ∀ {n : ℕ} {a : Set} → List a n → n   without iterating through the list?07/04 18:00
djahandarie"If I'm given n, is it possible to return n?" ;)07/04 18:03
Eduard_MunteanuYeah, something like that :).07/04 18:03
djahandarielength : {n : Nat} -> {a : Set} -> List a n -> n07/04 18:03
Eduard_MunteanuBut then,   length n xs = n   doesn't cut it.07/04 18:05
djahandarieDear god irssi is not handling this unicode well07/04 18:06
Eduard_MunteanuI'm using the standard lib Nat.07/04 18:06
Eduard_MunteanuActually I'm a bit confused how parameters that are types are handled.07/04 18:07
Eduard_Munteanu(like 'a')07/04 18:07
djahandarieThat function has 3 parameters.07/04 18:07
djahandarieTwo of them are implicit07/04 18:08
dantenI suppose that length returns Nat and not the argument n? anyway {n : Nat} is implicit so you have to bring it to scope on the left hand side07/04 18:08
djahandarie(Meaning it tries to infer them if you don't provide them)07/04 18:08
dantenlength {n} xs = n07/04 18:08
Eduard_MunteanuOh.07/04 18:08
djahandarieOh yeah, I missed that, sorry. You want Nat at the end07/04 18:08
Eduard_Munteanudjahandarie: yeah, but I don't think something like   length {n} {a} xs = ...   would make sense, right?07/04 18:09
Saizanit would07/04 18:09
djahandarieIt would make sense07/04 18:09
stevan[...] -> Exists N \m -> m == n  perhaps? :-)07/04 18:10
Eduard_Munteanulength : {n : ℕ} → {a : Set} → List a n → n     length {n} {a} xs = n07/04 18:10
Eduard_MunteanuBut I get... ℕ !=< _20 of type Set   when checking that the expression n has type _2007/04 18:11
stevanyou can't have [...] -> n, n is not a type -- it is a nat. it's like saying apa : [...] -> 307/04 18:11
dantenso you want to return a ℕ07/04 18:12
Saizanlength : {n : ℕ} → {a : Set} → List a n → ℕ; length {n} {a} xs = n07/04 18:12
Eduard_MunteanuOh07/04 18:12
Eduard_MunteanuYeah, I messed that up.07/04 18:12
Eduard_MunteanuThanks, it works now.07/04 18:13
Eduard_MunteanuBut how does a function that returns a type make sense? :)07/04 18:13
Eduard_Munteanu(Can I do that? say, f : .... -> Set)07/04 18:13
Saizann is not a type, if that's what you mwan07/04 18:13
dantenyes you can :)07/04 18:13
Saizan(yes)07/04 18:14
Eduard_MunteanuInteresting.07/04 18:14
danten(it is (possible))07/04 18:14
Eduard_MunteanuSo I don't have to get the stars aligned to write type functions like I did in Haskell.07/04 18:15
dantenyou can implement List (more commonly named Vec) as a function List : Set -> Nat -> Set ; List A 0 = Unit ; List A (suc n) = Pair A (List A n)07/04 18:16
Saizanyou can't pattern match on things of type Set though07/04 18:16
Eduard_MunteanuHm, nice, thanks.07/04 18:17
Eduard_Munteanu_++_ : {m : ℕ} → {n : ℕ} → {a : Set} → List a m → List a n → List a (m + n)07/04 18:36
Eduard_MunteanuWhy the hell isn't this more popular already? :)07/04 18:36
Eduard_MunteanuThat would have been so pissy to write in Haskell.07/04 18:43
Eduard_MunteanuI guess dependent types subsumes some linear types, right?07/04 18:43
Eduard_Munteanu(like sized types)07/04 18:44
djahandarieEduard_Munteanu, a new extension in Haskell actually makes that very easy to write07/04 18:45
Eduard_Munteanudjahandarie: the peano/naturals support? I thought that was going to be mere sugar for defining them.07/04 18:46
Eduard_MunteanuBut in Agda it seems you can have arbitrary computations inside types.07/04 18:46
Saizani don't think linear types are so easily subsumed, because the structural properties are taken for granted, but you should be able to embed them somehow07/04 18:47
Eduard_MunteanuTime for some theorems now, let's see how Curry-Howard goes in Agda.07/04 18:48
djahandarieEduard_Munteanu, I'm talking about diatchki's type-level nat extension07/04 18:53
Eduard_Munteanudjahandarie: yeah, but I thought it merely let you get type-level nats without typing silly stuff like TwentySeven = Succ (Succ (...07/04 18:57
djahandarieIt is not just sugar.07/04 18:57
djahandarieJust sugar would be nice though :)07/04 18:57
Eduard_MunteanuYeah.07/04 18:58
djahandarieBut Diatchki's thing is actually pretty powerful07/04 18:58
djahandarieIt can support (++) on vecs easily07/04 18:58
Eduard_MunteanuJust about every fake dependently-typed data structure comes with a huge list of Nats like that :)07/04 18:58
Eduard_MunteanuNice.07/04 18:59
jmcarthurhaskell can already support ++ on vecs pretty easily07/04 19:01
jmcarthurthe new type level nat stuff can do way more though07/04 19:02
djahandarieYes, it can, but not as nicely07/04 19:02
jmcarthur"niceness" isn't really what i'm getting at anyway07/04 19:03
jmcarthurit's fairly nice using type families for the type level addition though07/04 19:03
jmcarthurnot as nice as it should be though07/04 19:03
Eduard_MunteanuHrm, what's * in Agda?07/04 19:04
jmcarthurSet?07/04 19:04
jmcarthuri assume you mean "what is agda's equivalent to haskell's *"07/04 19:04
Eduard_MunteanuWell, does Set contain functions?07/04 19:05
Eduard_MunteanuHm wait, it kinda does.07/04 19:05
Eduard_MunteanuI was thinking of defining '<=>'.07/04 19:05
Saizan(x : A) -> B : Set (max i j), assuming A : Set i; B : Set j07/04 19:06
Eduard_MunteanuWhich should have the semantics of a -> b  and   b -> a07/04 19:06
Eduard_MunteanuHrm, Set is parametrized? :/07/04 19:07
djahandarieBy Level.07/04 19:07
Eduard_MunteanuOh, the tower of Sets. I guess normal Set is Set 0 ?07/04 19:07
djahandarieYou can use Set, Set_1, Set_2 ..., or turn on universal-polymorphism and do Set, Set 1, Set 2, Set N07/04 19:07
djahandarieYes07/04 19:08
Eduard_MunteanuAh, so only with that extension you get it.07/04 19:08
djahandarieYes, and that extension is freaking cool07/04 19:08
Saizanwithout the extension you have Set1 instead of Set 1, but the typing rules are the same07/04 19:08
Saizanand Set n : Set (n+1) of course07/04 19:08
* Eduard_Munteanu ponders data _≈_ (p q : Set) : Set or something like that07/04 19:10
Eduard_Munteanu... so I could write prop : [...] ≈ [...]07/04 19:10
Saizanor a record07/04 19:10
Eduard_MunteanuI'm not yet sure what the difference is :/07/04 19:11
Saizanthere's Function.Equivalence.Equivalence, but uses setoids07/04 19:11
Eduard_MunteanuNah, that'd be a spoiler :)07/04 19:11
Saizanwell, records have named fields, though they allow only one constructor, and have eta rules07/04 19:12
Saizaneta rules being e.g. (fst p , snd p) = p, if p : Pair A B; record Pair (A : Set) (B : Set) where field fst : A; snd : B07/04 19:13
Saizanwhich is not immediately obvious for the equivalent data type, though you can still prove it by pattern matching on p07/04 19:14
Eduard_MunteanuHrm, not much of a connection with eta reduction though.07/04 19:15
Saizanif you consider "\x ->" as a constructor it does07/04 19:16
Eduard_MunteanuOh.07/04 19:22
codolioThere's a categorical connection, too.07/04 19:28
Eduard_MunteanuHm, what's the function composition symbol in Agda?07/04 20:14
stevanit's defined in the Function module of the std lib07/04 20:16
dolio\comp07/04 20:20
dolioOr \o I think.07/04 20:20
Eduard_MunteanuHm, I had something similar, but different... ∘ vs ◦07/04 20:24
Eduard_MunteanuThanks.07/04 20:24
Eduard_MunteanuWhat's wrong with this? record _≈_ {n : ℕ} (a b : Set n) : Set (suc n) where [...]07/04 20:42
Eduard_MunteanuAgda says "ℕ !=< .Level.Level of type Set when checking that the expression n has type .Level.Level"07/04 20:42
Saizanthe index for Set is not a ℕ07/04 20:43
Saizanit's a Level, defined in the Level module07/04 20:43
Eduard_MunteanuAh, I suppose I should've looked into the source, thanks.07/04 20:44
dolioYou should be able to just write {n}. Agda will infer the type.07/04 20:51
wharrrgarblZE PENTAGON07/04 21:34
wharrrgarblSHE IZ ALMOZT DUN07/04 21:34
wharrrgarblit's only taking this long cause I have no time07/04 21:34
wharrrgarbl:(07/04 21:34
Adamantwharrgarbl07/04 21:34
wharrrgarblWHARRGARBL07/04 21:34
Adamantindeed07/04 21:34
wharrrgarblloading this file is fairly painful now07/04 21:36
wharrrgarblthe problem is that when I need to add more steps to my hom setoid reasoning proofs07/04 21:36
wharrrgarblI need to reload07/04 21:36
augurSHOULD I ABANDON AGDA FOR COQ? D:07/04 21:44
augurno im kidding <307/04 21:44
wharrrgarblfucking hell07/04 22:00
wharrrgarblI need to get a 64-bit GHC to even compile this thing07/04 22:01
wharrrgarblsince it dies at 3g07/04 22:01
Eduard_MunteanuHah, I googled wharrrgarbl, it seems there is something behind that name.07/04 22:04
Adamantthe picture is great.07/04 22:11
xplatwharrrgarbl: now that i've seen what the raw pentagon for cartesian turns into 3GB to typecheck doesn't seem quite so incredible anymore07/04 23:45
xplatthat actually is about the size of types i got from boost::proto07/04 23:46
wharrrgarblboost::proto?07/04 23:46
wharrrgarblbut yeah, I'm trying to think of how to break this up so it's manageable07/04 23:46
xplatthe library behind version 2+ of boost::spirit07/04 23:46
wharrrgarblI'm so close to finishing this proof07/04 23:47
wharrrgarblbut after adding more steps to my equational reasoning it just won't reload07/04 23:47
xplat(boost::proto is, in particular, a C++ compile-time DSL based on extension templates, for the purpose of writing your own C++ compile-time DSLs based on expression templates)07/04 23:51
wharrrgarblhmm!07/04 23:52
wharrrgarblsounds like fun07/04 23:52
xplatit's one of those things that sounds like way more fun than it is07/04 23:52
xplatyour downstream users end up needing a briefcase to carry their compile errors07/04 23:53
xplatone more level of meta and it would be a pack mule, i think07/04 23:54
augurhey07/04 23:54
wharrrgarblyo07/04 23:56
--- Day changed Fri Apr 08 2011
Saizanhttp://hpaste.org/45447/weird_error <- do you also get this error?08/04 00:09
jmcarthurSaizan: open import?08/04 00:30
Saizanjmcarthur: oh, d'oh, thanks!08/04 00:30
jmcarthurit hits me all the time08/04 00:30
Eduard_MunteanuOh, that was for me.08/04 00:31
Eduard_MunteanuOr in connection to what I said :/08/04 00:32
Saizani was trying to implement fix :)08/04 00:33
wharrrgarblokay, armed with my new 64-bit agda, I shall try once more08/04 01:03
wharrrgarblthis proof will not defeat me!08/04 01:04
wharrrgarblunfortunately it means that I need to rebuild this stuf08/04 01:05
SaizanEduard_Munteanu: http://hpaste.org/45449/fix_in_agda08/04 01:08
wharrrgarblyay08/04 01:09
Eduard_MunteanuSaizan: so with the termination checker on, I suppose it's still safer (better behaved) than Haskell's 'fix' right?08/04 01:11
Saizanmh, maybe it's not quite correct :)08/04 01:11
Saizanit shouldn't be08/04 01:11
Saizanexcept wrt unfolding at compile time, but haskell doesn't do any of that08/04 01:12
Saizani think my problem is that i should use a fixpoint combinator for an eager language08/04 01:13
Saizanhttp://hpaste.org/paste/45449/fix_in_agda_annotation#p45450 <- ok, this one is legitimate (i found it in some old code of mine, probably taken off some mailing list post)08/04 01:25
Saizanless efficient than one might hope, but that's true of other fixpoint combinators in languages without a suitable let08/04 01:26
Eduard_MunteanuHm, thanks, I'll try playing with it.08/04 01:27
Saizanfix id : a -> b \bot, so it's justly badly behaved :)08/04 01:28
xplatyeah, behaving badly is kind of what fixpoint combinators do08/04 01:33
augurbut fixed points are cool!08/04 01:34
augur:(08/04 01:34
* Eduard_Munteanu wonders if Agda can grok Y08/04 01:37
Eduard_MunteanuMmm, does anybody know if pumpkin's CT stuff he did in Agda is online somewhere?08/04 01:40
* Eduard_Munteanu is looking for ideas08/04 01:40
dolioYes. Someone knows.08/04 01:41
Eduard_Munteanu:)08/04 01:41
dolioIt's on github somewhere.08/04 01:42
Eduard_MunteanuAh, pumpkin's Github stuff is in my FF history, thanks.08/04 01:43
copumpkin?08/04 01:43
Eduard_Munteanucopumpkin: I was looking for your CT stuff you did in Agda.08/04 01:43
copumpkinah08/04 01:43
copumpkingood luck typechecking it08/04 01:44
copumpkinmy computer is sweating08/04 01:44
Eduard_MunteanuPhenom II quad core, 6 GiB RAM, should be good :P08/04 01:44
copumpkindon't be too sure ;)08/04 01:44
copumpkinbut I'm sure it won't be terrible08/04 01:45
copumpkinkeep in mind that my library conflicts with the standard one08/04 01:45
copumpkinso you'll have to move one out of the way while you play with the other08/04 01:45
Eduard_MunteanuYeah I saw you were struggling to migrate from x86-32 stuff.08/04 01:45
Eduard_MunteanuOh, for the moment I came up with some symlink hacks to get the Agda lib running so it's as simple as unpacking yours into a new dir.08/04 01:46
Eduard_Munteanu(I'm just supplying a path to agda on the cmdline)08/04 01:46
copumpkinwait, why are you running agda manually?08/04 01:47
copumpkinsounds like a recipe for frustration08/04 01:47
Eduard_MunteanuYeah I should probably get Emacs stuff.08/04 01:47
copumpkinseriously08/04 01:47
copumpkinanything nontrivial will be a real pain08/04 01:47
Eduard_MunteanuYou mean typing symbols? I can already do that easily in Vim.08/04 01:48
copumpkinno08/04 01:48
copumpkinI mean actually writing proofs :P08/04 01:48
djahandarieHaha, typing symbols is fairly trivial...08/04 01:48
Eduard_MunteanuThough I had to read the stdlib source code to get myself started.08/04 01:48
copumpkinI don't think anyone sits down and "writes a proof"08/04 01:49
Eduard_MunteanuOh, you mean I should use tactics.08/04 01:49
copumpkinyou write some types, see what types your holes are (using the emacs mode), then fill them in, write some lemmas, use the refine feature, use the case splitting feature08/04 01:49
copumpkinno, I mean you should use the emacs mode :P08/04 01:49
djahandarieYes, he's saying you should use Coq08/04 01:49
Eduard_MunteanuHeh.08/04 01:49
copumpkinbeing able to interact with the typechecker on a partially typechecked program is crucial08/04 01:50
djahandarie(I think you can actually use tactics in Agda using reflection but it isn't done very often afaik)08/04 01:50
copumpkinwhen your goals are even a couple of lines long08/04 01:50
copumpkindjahandarie: that's cause we don't really have any fully implemented tactics. I wonder where that presburger solver went08/04 01:51
Eduard_MunteanuEpigram must also be messy without an IDE.08/04 01:52
Eduard_MunteanuEspecially given the way you lay things out.08/04 01:53
copumpkinthe next best thing is a repl-like thing08/04 01:53
copumpkinanything but a plain old text editor, I guess :P08/04 01:53
* copumpkin shrugs08/04 01:53
djahandarieI write Agda using Notepad08/04 01:53
copumpkinanyway, it'll steepen your learning curve significantly if you can't use any of the interactive tools08/04 01:54
Eduard_MunteanuYeah, I haven't got to any non-trivial proofs yet, I started by doing some IO, making a dependently typed list etc.. Basically relearning stuff from Haskell.08/04 01:55
copumpkinyeah, fair enough08/04 01:55
copumpkinfor now you don't really need that stuff08/04 01:55
copumpkinokay, I may have a solution to typechecking this beast08/04 02:35
copumpkinsince even with 64-bit GHC, I don't actually have enough RAM for it08/04 02:35
copumpkinmaybe due to the larger pointers now08/04 02:35
xplati was reading about the typeclass-based representation of CT in coq08/04 03:06
xplatit seems like among the other benefits they mentioned it would also make the records smaller08/04 03:06
xplatand thus typechecking faster08/04 03:06
copumpkinmmm08/04 03:07
xplati can see how checking equality of records with functions in them can be difficult08/04 03:09
copumpkindid you see the full implicits on the pentagon type?08/04 03:10
copumpkinhttp://dl.dropbox.com/u/361503/holycrap.txt08/04 03:10
copumpkinalmost a megabyte of type08/04 03:10
xplat... coincidentally enough, that's the filename i would have used too08/04 03:11
djahandarieHaha08/04 03:11
copumpkin:)08/04 03:11
djahandarieWhy is it so big?08/04 03:12
copumpkinI have yet to get the damn half-proof to load08/04 03:12
copumpkinbecause THIS IS PENTAGON, that's why08/04 03:12
xplatlots of snds and fsts, it seems like normalizing more would actually make it faster in this case08/04 03:12
copumpkinit can't normalize any further?08/04 03:13
copumpkinit has a huge 4-tuple as input08/04 03:13
xplatbitten by lazy space leaks IN THE TYPE SYSTEM.  it's like the anti-oleg08/04 03:13
djahandarieWhy doesn't Oleg do Agda?08/04 03:14
djahandarieSeems like he'd be right at home08/04 03:14
xplatdjahandarie: too easy, that's why08/04 03:14
xplatremember, he does iteratees and type-level hackery in haskell, but regular monads he bothers with only in scheme08/04 03:15
copumpkinmaybe I'll do something else08/04 03:16
copumpkinlike work on my disassembler a bit08/04 03:16
copumpkingetting frustrated with the memory08/04 03:16
copumpkinor lack thereof08/04 03:16
copumpkinoh I was thinking of playing with catalan numbers in agda08/04 03:17
copumpkinso many choices!08/04 03:17
djahandarieI _really_ need fix my Agda build on this computer08/04 03:17
djahandarieIt's all cabal's fault. No matter how much I use cabal I still manage to muck things up with it08/04 03:18
copumpkinI just blow my cabal away regularly08/04 03:18
sordinadjahandarie: Me too. I'm thinking of creating a dedicated agda user so that I can have a stable install.08/04 04:20
augurso whats up with that error message?08/04 05:40
augur⊥ ∧ ⊥ → ⊥ != {x y z : One} → const2 ⊥ x y ∧ const2 ⊥ y z → const2 ⊥ x z because one is an implicit function type and the other is an explicit function type08/04 05:41
augurthe structure of the code is such that i need something of type Transitive (const2 \bot x y) /\ Trichotomous (const2 \bot x y), in this case it seems to be failing on the transitive proposition08/04 05:42
augurbut i already know that the thing in question IS a transitive proposition that type checks!08/04 05:43
Saizandependent irrelevance :O08/04 15:21
copumpkin:O08/04 15:24
copumpkin?08/04 15:24
xplataugur: well, those two things definitely are unequal08/04 15:26
copumpkinxplat: still no cartesian :(08/04 15:28
copumpkinmaybe I'll go get myself a bigger computadora08/04 15:28
Saizancopumpkin: i just pulled a patch which seems to implement it08/04 15:28
copumpkin?08/04 15:29
copumpkinoh08/04 15:29
copumpkinwait, so you can have (.x : A) -> f x08/04 15:29
copumpkin?08/04 15:29
copumpkinthat seems funny08/04 15:29
Saizanyep, written .(x : A) -> f x though08/04 15:30
copumpkininteresting08/04 15:31
djahandarieWhat would that mean?08/04 15:31
copumpkinthat means I can make one more thing irrelevant in my library08/04 15:31
copumpkincan't remember what though, but I remember wanting it08/04 15:31
copumpkindjahandarie: pseudoparametricity, among other things, I think08/04 15:31
djahandarieWhy can't Agda figure out irrelevant things automatically?08/04 15:38
Saizandoesn't work for HOFs for example08/04 15:39
Saizanand, anyhow, these aren't for runtime optimizations, but to get additional "parametricity"08/04 15:40
djahandarieHm. I think I need an example :p08/04 15:40
Saizani.e. if you get passed a function f of type .A -> B, then you know that f x = f y08/04 15:41
xplatwhat is the difference between pseudoparametricity and parametricity?08/04 15:41
djahandarieHmm08/04 15:42
djahandariesplit : (.A -> .B -> C) -> .(A x B) -> C; split k p = k (fst p) (snd p);  -- how is this of any use then?08/04 15:43
xplatdjahandarie: just to change types?08/04 15:45
xplatboth of them must be constant functions, but with different types08/04 15:46
Saizanconstant function is a bit too strong08/04 15:46
xplatpseudoconstant function?  :)08/04 15:46
Saizanas you see p is used by split, but only in irrelevant positions, and C might well be a type with some irrelevant fields08/04 15:47
xplatah, yes08/04 15:47
Saizani.e. C could be Functor F; and A and B the two functor laws08/04 15:48
xplatso if C has no irrelevant components then k and split k must be constant08/04 15:48
xplati sort of thought of C that way to begin with i guess, but that was insufficiently general ...08/04 15:49
djahandarieSo you would only be using this function somewhere where the end result is going to be irrelevant anyways?08/04 15:50
Saizananything irrelevant is a bit like a binary flag, "does this hold or not? i don't care how"08/04 15:50
xplatdjahandarie: where part of the end result is going to be irrelevant.08/04 15:50
djahandarieBut you can't make any changes to the relevant part of it?08/04 15:51
djahandarieAny non-constant changes to the relevant part, I guess08/04 15:51
Saizanright, you can't08/04 15:51
xplatright.  but the irrelevant parts that can change can be arbitrarily deeply buried in the type of C08/04 15:51
djahandarieOkay, cool08/04 15:52
xplatlike it can be a list of maps from strings to ints, where the strings carry a proof that they are all uppercase :)08/04 15:52
xplatand that proof, for each string, can depend on p08/04 15:53
xplat(as long as that proof is marked irrelevant in the uppercase-string record)08/04 15:55
xplatcopumpkin: i feel like there ought to be ways to make types like holycrap.txt smaller08/04 15:56
Saizan /win 1208/04 15:59
xplatcopumpkin: at first i thought it should be possible to normalize away the fsts and snds, but now i see that they are internal fst and snd and so agda doesn't know how to get rid of them at that point08/04 15:59
xplatSaizan: when you ' /win' you lose08/04 15:59
Saizanyeah. and window 12 is actually this one, even.08/04 15:59
djahandarieHaha fail08/04 16:00
augurxplat: i can see that but i dont understand why it turns out to be that way08/04 18:54
copumpkinxplat: I broke your remote URL for categories, sorry :(08/04 20:48
xplatcopumpkin: er, what?08/04 21:49
auguro hai08/04 21:50
auguri cant wile away my time, so08/04 21:51
augurhttp://hpaste.org/45467/syntax_crap08/04 21:52
auguri dont understand why linear-unit is failing :(08/04 21:52
copumpkinxplat: I changed my username on github to copumpkin, so your url pointing to pumpkin is now broken08/04 21:53
Saizanaugur: try "linear-unit = conj (\{x}{y}{z} -> trans-unit {x} {y} {z}) (\{x}{y} -> trich-unit {x} {y})"08/04 21:55
augurSaizan: aha! i had to wrap both08/04 21:57
augurinteresting08/04 21:57
augurweird tho08/04 21:57
Saizanpassing functions that take implicit arguments often requires that eta-expansion08/04 21:58
augurwhy? :\08/04 22:00
Saizanbecause if f : {x : A} -> ..., then an expression like "f" has to mean "f {_}" most of the time08/04 22:01
Saizanand typechecking can't always figure out that it should wrap that in a \{x} -> in this case08/04 22:02
augurhm. thats weird in this case tho, cause it succeeds if i use \{_ _ _} -> trans-unit08/04 22:03
augurwithout any arguments for trans-unit08/04 22:03
Saizanno idea if this is just a shortcoming of the current implementation or something fundamental08/04 22:03
copumpkinaugur: you can't group them like that?08/04 22:03
augurcopumpkin: apparently i can08/04 22:03
Saizanbecause it can then figure them out by the type08/04 22:03
copumpkin:O08/04 22:03
Saizanfiguring out where to put the lambdas seems to be the hardest part08/04 22:04
xplatif 'f' has implicit arguments that are after any explicit arguments you may have supplied, agda will always fill in those implicits with {_}08/04 22:16
xplatso if you want to keep the implicit args unspecified, you always have to wrap in a lambda08/04 22:17
xplatagda will not even try to figure that out from the type.  ever.08/04 22:17
Saizanever? i think i found occasions where it did in the past08/04 22:20
augurhm08/04 22:24
augurso i obviously cant do patterns like (constructor f) : Foo huh08/04 22:24
Saizanwhat does that mean?08/04 22:28
copumpkinyou want to put a type annotation on a pattern? :o08/04 22:29
auguruh08/04 22:29
augurno no its supposed to be in a type08/04 22:29
augurso like instead of (cf : Foo) -> P cf08/04 22:29
augur((c f) : Foo) -> P f08/04 22:29
Saizanah, no, you can't08/04 22:29
auguri guess its a case issue08/04 22:30
augurmakes sense08/04 22:30
Saizanwell, what makes sens is just abstracting over a f with the right type08/04 22:30
xplator more relevantly to this case, you could replace P with a function that case matches the f out of c and applies P to it08/04 22:40
Eduard_MunteanuMmm, I just emerged Agda on Gentoo, but Emacs hangs up when trying to open an Agda file (even create a new one).08/04 23:35
Eduard_Munteanusci-mathematics/agda-2.2.6-r108/04 23:36
augurgrr08/04 23:49
augurthis is confusing08/04 23:49
Eduard_MunteanuMmm, yeah, that's how I feel too :P08/04 23:52
augur:p08/04 23:52
augurive got to prove that Transitive _~_ -> Transitive _~'_ -> Transitive (_~_ ++ _~'_)08/04 23:53
auguri know that ++ is indeed transitivity preserving from the definition (its just disjoint union of the relations, plus bridging over the underlying sets with a constant relation)08/04 23:53
augurbut i dont know how to witness that08/04 23:54
augurcause it ends up being that _~_ ++ _~'_ is just {x y z} -> x ~ y & y ~ z -> x ~ z08/04 23:55
augurbut if i do a case analysis, i dont know how to get an x ~ z :\08/04 23:55
copumpkinhow is ~ defined? and/or can we see the code?08/04 23:57
auguri dont want you to write me code for me tho! :(08/04 23:57
copumpkinI won't08/04 23:57
Eduard_MunteanuI figure '~' composes somehow.08/04 23:57
augurhttp://hpaste.org/45469/transitivity08/04 23:58
--- Day changed Sat Apr 09 2011
copumpkinhmm09/04 00:00
auguri mean, in the simple case its just09/04 00:01
Eduard_MunteanuDamn you GHC!!!   Loading package terminfo-0.3.1.1 ... can't load .so/.DLL for: ncursesw (/usr/lib64/libncursesw.so: invalid ELF header)09/04 00:01
* Eduard_Munteanu 's lucky he tried :set -package Agda-2.2.609/04 00:02
copumpkinaugur: use the existing transitivity proofs09/04 00:02
augurcopumpkin: what?09/04 00:02
copumpkinlet me try to make sure I'm not talking out of my ass09/04 00:02
copumpkinaha09/04 00:03
copumpkinso type p1 into the hole and press C-c C-r09/04 00:03
copumpkinit'll give you a few more holes09/04 00:03
copumpkinthen you will see where to go next09/04 00:03
copumpkinalso, are you using C-c C-, ?09/04 00:03
copumpkinit's immensely useful09/04 00:03
augurdunno what Cc C, does09/04 00:04
copumpkinoh okay09/04 00:04
copumpkinthis will help you a lot09/04 00:04
copumpkinso go into the hole you have there09/04 00:04
copumpkinand press C-c C-,09/04 00:04
copumpkinthe bottom window should tell you what it wants and what you have09/04 00:04
copumpkinhttp://hpaste.org/paste/45469/transitivity_annotation#p4547009/04 00:05
copumpkinit's telling you that the hole needs to be of type x ~ z09/04 00:05
copumpkinand you have a few things in scope there09/04 00:05
copumpkinnow, of the things you have in scope, what looks promising as a path to get to x ~ z ?09/04 00:05
augurspeaking of bottom window09/04 00:06
augurmy bottom window is now on the right :|09/04 00:06
copumpkinoh yeah, it does that for me sometimes09/04 00:06
augurhow do i fix that09/04 00:06
copumpkinafter some voodoo, I can get it back to the bottom09/04 00:06
copumpkinput your cursor into it09/04 00:06
augurx.x09/04 00:06
augurinto it!09/04 00:06
copumpkinthen go into window09/04 00:06
augurwindow!09/04 00:07
copumpkinand say join windows09/04 00:07
copumpkinor maybe it's split09/04 00:07
augurhmm09/04 00:09
augurwell i got it down to the bottom09/04 00:09
augurso whats this CcC, do now?09/04 00:11
copumpkin?09/04 00:11
augurC-c C-,09/04 00:11
copumpkinit gives you most of the things you have in scope for your proof09/04 00:12
copumpkinand what you need to provide09/04 00:12
augurah09/04 00:12
augurhmm09/04 00:12
copumpkinso it's basically building blocks and a goal09/04 00:12
copumpkinnow you need to look at those blocks and figure out which ones you can put together to get at the goal09/04 00:12
copumpkinanyway, I proved it09/04 00:12
augurshut your face09/04 00:13
copumpkinyou may also want C-c C-c09/04 00:13
augurwotsat09/04 00:13
copumpkinsince there are lots of cases09/04 00:13
copumpkinC-c C-c automatically pattern matches on a value09/04 00:13
copumpkinso you don't have to go writing a dozen inl/inr combinations09/04 00:13
copumpkinyou still have to do a few because it won't do lots of them at once for you09/04 00:13
augurhow do you use it?09/04 00:13
copumpkinso say you have f x y z = ?09/04 00:13
copumpkinthe ? is actually { }009/04 00:13
copumpkinput your cursor in the hole and press C-c C-c09/04 00:14
copumpkinthen type in y09/04 00:14
copumpkinand if the type of y is a datatype with constructors09/04 00:14
copumpkinit'll make as many clauses as there are constructors09/04 00:14
copumpkinwith autogenerated names for the parameters09/04 00:14
augurhmm09/04 00:14
copumpkinso if y was a sum09/04 00:14
copumpkinit'd give you09/04 00:14
copumpkinf x (inl y) z = ?09/04 00:14
copumpkinf x (inr y) z = ?09/04 00:14
augurhm!09/04 00:15
copumpkinyou can then do it again to split it into 4 cases on z09/04 00:15
copumpkinI have a pending feature request to have it do lots of parameters at once09/04 00:15
copumpkinsince the number expands exponentially and gets annoying09/04 00:15
copumpkinbut it's still less annoying than writing the cases out by hand09/04 00:15
copumpkinI usually hate its names so go and rewrite them after it's written the cases for me09/04 00:15
augurim still not sure how to prove this x.x09/04 00:16
copumpkinwell you have the inl/inl/inl case09/04 00:17
auguryes09/04 00:17
copumpkinI put the context in the annotation09/04 00:17
copumpkinlook at that p1 you have there09/04 00:17
copumpkinp1   : (x' y' z' : .X) → x' ~ y' ∧ y' ~ z' → x' ~ z'09/04 00:17
copumpkinit can _give you_ a proof of x' ~ z'09/04 00:17
copumpkinand you want a proof of x ~ z09/04 00:17
copumpkinbut p1 lets you specify the z' and z'!09/04 00:18
copumpkinx' and z'09/04 00:18
augurhmm09/04 00:18
copumpkinp1 is a proof generator09/04 00:18
augurhmm!09/04 00:18
copumpkinGoal: x ~ z09/04 00:18
copumpkinp1   : (x' y' z' : .X) → x' ~ y' ∧ y' ~ z' → x' ~ z'09/04 00:18
copumpkinso that means that if you want to use p1 to prove your goal09/04 00:18
copumpkinyou need x' = x and z' = z09/04 00:19
copumpkiny is up to you09/04 00:19
copumpkinyou also need an x ~ y' ∧ y' ~ z though09/04 00:19
copumpkinbut look at p309/04 00:19
copumpkinp3   : x ~ y ∧ y ~ z09/04 00:20
copumpkinyou see where I'm going?09/04 00:20
augurhmm09/04 00:20
augurmaybe!09/04 00:20
augurhold on lemme look at this09/04 00:20
copumpkinsure09/04 00:20
copumpkinthe basic point is that of the things in your context, only p1 returns something compatible with your goal09/04 00:21
copumpkinso my usual approach is to type in p1 and C-c C-r into the hole09/04 00:21
copumpkinit'll then give you four holes in return, one for each parameter of p109/04 00:21
copumpkinthen you can go and see whether you know how to fill those in09/04 00:21
copumpkinit's all about simplifying your goal until it's obvious how to prove it09/04 00:21
auguraha!09/04 00:22
augurp1 x y z p3!09/04 00:22
copumpkinyes!09/04 00:22
augurnow to properly understand why the hell that makes sense09/04 00:22
augurlol09/04 00:22
copumpkin:)09/04 00:22
augurwell, lemme finish this thing first09/04 00:22
augurthen ill understand09/04 00:22
copumpkinyep09/04 00:23
copumpkinsome of the cases you'll need to prove will be a lot easier than others09/04 00:23
augurc'est fini!09/04 00:32
augurthis ccc, thing is GREAT09/04 00:32
augurholy moley09/04 00:32
copumpkin:)09/04 00:33
copumpkinisn't it fun!09/04 00:33
augurit is rather09/04 00:34
auguri wish i could chance the keybindings tho09/04 00:34
copumpkinit's a bit like a puzzle game with a really awful UI09/04 00:34
auguron a macbook, control is a pain in the ass09/04 00:34
copumpkinbut where you can make your own puzzles09/04 00:34
copumpkinyeah, I'm on a mac too09/04 00:34
copumpkinyou probably can change them09/04 00:34
copumpkinit is emacs, after all09/04 00:34
copumpkinbut my emacs-fu is weak09/04 00:34
auguror if i could use my mouse to expand stuff09/04 00:34
auguroh theres a menu i can use maybe?09/04 00:35
copumpkinI think you can09/04 00:35
copumpkinnot sure09/04 00:35
copumpkinright click in the hole09/04 00:35
copumpkinit might give you some options09/04 00:35
auguryeah it seems to have them09/04 00:35
augurhmm09/04 00:36
* copumpkin is fighting with misbehaving scala code!09/04 00:39
augurwhy does this thing always case expand as y?09/04 00:42
augur:|09/04 00:42
copumpkincause it's dumb :P09/04 00:43
copumpkinhowever09/04 00:43
copumpkinif you name your constructor parameters, dependent style09/04 00:43
copumpkinit'll use those names if possible09/04 00:43
copumpkinso something like09/04 00:43
copumpkin_::_ : (x : A) -> (xs : List A) -> List A09/04 00:43
copumpkinnow when you case match on a List, it'll write (x :: xs)09/04 00:44
copumpkininstead of (y :: y1)09/04 00:44
auguri just dont get why it cant expand as the original variable09/04 00:46
augurif i do C-c C-c z09/04 00:46
augurwhy cant it expand as z z' z'' z''' ...09/04 00:46
copumpkincause it's dumb :P09/04 00:46
copumpkinmake a feature request on the bug tracker or submit a patch09/04 00:46
copumpkinI'm sure that'd be trivial to change09/04 00:46
copumpkinpicking nice variable names isn't very high on their list of concerns, I'd imagine09/04 00:46
augurprobably not09/04 00:46
augurbut its on mine!09/04 00:46
Eduard_MunteanuHm, do you guys have syntax highlighting in Emacs for Agda code?09/04 00:55
Eduard_MunteanuAll I see is just a different color for comments :/09/04 00:55
auguryes, in aquamacs09/04 00:55
dolioIt colors after you load the file.09/04 00:56
augurcopumpkin: why does my goal have different parts to it?09/04 00:56
dolioColor is based on what things are.09/04 00:56
copumpkinaugur?09/04 00:56
copumpkinhow so09/04 00:56
dolioConstructor, coconstructor, projection, etc.09/04 00:56
Eduard_Munteanudolio: I did load a file09/04 00:56
augurwell, i have an obnoxious 20 or 30 line goal, but the first line isnt connected to the rest09/04 00:56
Eduard_Munteanu(that was already there)09/04 00:56
copumpkinEduard_Munteanu: C-c C-l09/04 00:56
copumpkinnot load as in open09/04 00:56
copumpkinaugur: ???09/04 00:57
augurcopumpkin: http://hpaste.org/paste/45469/transitivity_annotation#p4547409/04 00:57
Eduard_Munteanucopumpkin: emacs Foo.agda   on the cmdline09/04 00:57
Eduard_MunteanuBut lemme try that...09/04 00:57
copumpkinaugur: it is connected somehow09/04 00:57
copumpkinit's probably just applied to the rest?09/04 00:57
auguri figure!09/04 00:57
auguroh maybe09/04 00:57
augurhm09/04 00:58
augurweird09/04 00:58
augurhow.. does one prove such a thing? o_O09/04 00:58
copumpkinby pattern matching, probably09/04 00:59
copumpkinyou probably have a bunch of inputs that are ADTs?09/04 00:59
copumpkinpattern matching on one of them will allow it (I hope) to reduce your goal a bit more in that clause09/04 00:59
auguroh maybe lemme see09/04 00:59
augurhmm!09/04 01:01
copumpkinnot knowing what you're proving, I'd guess that matching on enough constructors will reduce the complexity of that thing significantly09/04 01:01
copumpkindown to something manageable09/04 01:01
Eduard_MunteanuHm, I suppose I don't get any highlighting if I have errors in my .agda09/04 01:02
copumpkinin theory you could, but in practice I don't think you do09/04 01:02
* Eduard_Munteanu starts another file09/04 01:02
Eduard_MunteanuBTW, how should I use/install the standard lib?09/04 01:03
Eduard_MunteanuI'm currently using a symlink hack.09/04 01:03
Eduard_MunteanuNasty.09/04 01:03
augur_how come refinements only work sometimes? and type checking when something inside a goal shields it from failure?09/04 01:05
Eduard_MunteanuWait, I got it... http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.Standardlibrary09/04 01:07
augur_is there a built in case expression other than with/09/04 01:13
Saizanno09/04 01:13
augur_:\09/04 01:14
Saizanand refinements only apply to what's already in the context or goal09/04 01:15
augur_eh?09/04 01:15
augur_i just mean, sometimes if i do a refinement, itll strip the goal {}s and other times it wont09/04 01:16
Saizanah, that refinement09/04 01:18
Saizanwell, when it doesn't it means it failed, iirc09/04 01:18
augur_hm!09/04 01:21
Eduard_MunteanuMmm, existential quantification looks strange in Agda...09/04 01:29
dolioIt's a datatype. It lacks syntax.09/04 01:30
Eduard_Munteanu∃ = Σ _09/04 01:30
dolioOr, there's some syntax with the new syntax thing, but it's a bit less than you might hope for.09/04 01:31
Eduard_MunteanuYeah, it doesn't even look like Curry Howard stuff anymore :)09/04 01:31
Eduard_MunteanuIt's too straightforward.09/04 01:31
dolioYou can write Σ[ x : T ] U09/04 01:32
dolioOnly not with that colon.09/04 01:32
dolioAnd U will probably need parentheses.09/04 01:33
dolioIt needs to be the \: colon.09/04 01:33
dolioT will need to be parenthesized if it contains an arrow, too.09/04 01:35
Eduard_MunteanuHm, Set = Set₁ ?09/04 01:37
Eduard_MunteanuOr is Set = Set 0?09/04 01:37
dolio009/04 01:37
Eduard_MunteanuAh, thanks.09/04 01:37
Eduard_MunteanuSo if I'm guessing right, the equivalent of a type operator in Haskell would be a member of / type in Set₁09/04 01:38
copumpkinwell, * -> * in Haskell is Set -> Set in Agda09/04 01:41
copumpkinbut Set -> Set is itself in Set109/04 01:42
Eduard_MunteanuMmm, looks like I can't really write ∃ a just like that :)09/04 01:53
Eduard_Munteanudirect : ∀ { p : Set₁ } → (∃ a → p a) → (∀ r -> (∀ a -> a -> r) -> r)09/04 01:53
Eduard_MunteanuThat's probably wrong in many ways ^09/04 01:53
Eduard_Munteanuoops, (∀ a -> p a -> r)09/04 01:54
copumpkinno, but if you stick a lmbda after the exists09/04 01:56
copumpkinand p isn't a Set\_109/04 01:56
copumpkinI think this is rather confused :P09/04 01:57
Eduard_MunteanuNo? I mean, my equivalent Haskell theorem was like...09/04 01:57
Eduard_Munteanudirect :: forall (p :: * → *). Exists p → (forall r. (forall a. p a → r) → r)     where data Exists (p :: * → *) = forall a. MkExists (p a)09/04 01:57
copumpkinas I said, * -> * corresponds to Set -> Set09/04 01:58
copumpkinthen you write exists p09/04 01:58
copumpkinnot a -> p a09/04 01:58
copumpkinand your binding of a isn't correct in the return type09/04 01:58
copumpkinactually, it might be09/04 01:58
copumpkinbut you probably want it to be implicit09/04 01:58
dolioYour dots should be arrows.09/04 01:59
dolioAnd your :: should be :09/04 01:59
copumpkinand your * should be Set09/04 01:59
Eduard_MunteanuHrm, so Set\_1 is too big, is that the issue?09/04 01:59
copumpkinSet\_1 is the _type_ of Set -> Set09/04 02:00
copumpkinyou want p to be a value of Set -> Set09/04 02:00
dolioNot everything in Set1 is a function from types to types.09/04 02:00
Eduard_MunteanuOh, right.09/04 02:00
xplatin fact nothing in Set1 is a function from types to types.09/04 02:01
Eduard_Munteanu< copumpkin> not a -> p a    -- why wouldn't I do ∃ a → p a ?09/04 02:01
copumpkinbecause exists isn't a binder like lambda09/04 02:01
copumpkinit isn't magically giving you an a there09/04 02:01
xplatyeah, you need to put in your own binder09/04 02:01
Eduard_MunteanuAh, yes, I figured that, but how do I go around it?09/04 02:02
copumpkinyou can write exists p09/04 02:02
copumpkinlike you did in haskell09/04 02:02
copumpkinor you can write exists \lambda a -> p a09/04 02:02
Eduard_MunteanuHrm, but in Haskell my Exists rested upon a specific definition :/09/04 02:02
copumpkinso does this one09/04 02:02
Eduard_MunteanuOh.09/04 02:02
copumpkinexists is just another datatype09/04 02:03
copumpkinnot a primitive09/04 02:03
copumpkinit's basically a pair09/04 02:03
Eduard_MunteanuYeah, it's a datatype which I don't really get :)09/04 02:03
dolioExists in Agda is superior, though.09/04 02:03
* copumpkin bows to The Great Exists09/04 02:03
dolioBecause it's parameterized by the type that the existential is quantifying over.09/04 02:03
dolioWhich is impossible in Haskell.09/04 02:03
Eduard_Munteanu∃ = Σ _   is a bit uh.09/04 02:03
dolioThat means that the first argument is supposed to be inferred.09/04 02:04
Eduard_MunteanuSo it's actually   ∃ = \x -> (something, x)09/04 02:05
dolioNo.09/04 02:05
dolioIt means \ex P = \Sigma _ P09/04 02:06
dolioWhere the _ is inferred.09/04 02:06
copumpkinEduard_Munteanu: in agda you can have value inference09/04 02:07
copumpkinnot sure if that was obvious09/04 02:07
copumpkin(assuming the type is constrained enough)09/04 02:07
xplatin fact type inference is basically the same thing as value inference09/04 02:07
xplatit's just that the values happen to be types09/04 02:07
copumpkinI wonder what's the highest concrete universe anyone has worked with in agda09/04 02:08
Eduard_MunteanuHuh?09/04 02:08
copumpkinEduard_Munteanu: huh about what?09/04 02:08
Eduard_MunteanuI thought this was about guessing which argument '_' referred to.09/04 02:08
Eduard_MunteanuBut it sounds deeper.09/04 02:09
copumpkinEduard_Munteanu: you can write _ in any expression09/04 02:09
copumpkinif it's uniquely determined by other stuff, agda will infer its value for you09/04 02:09
copumpkinotherwise it'll turn yellow and throw a tantrum09/04 02:09
Eduard_MunteanuOh!09/04 02:09
copumpkinso if I have09/04 02:09
copumpkinx : Vec Nat 009/04 02:09
copumpkinx = _09/04 02:09
Eduard_MunteanuSo that's how I start proving my theorem, I did   direct = direct   just to be able to load it.09/04 02:10
copumpkinAgda should be able to figure out that x must be []09/04 02:10
Eduard_MunteanuSo I should do   direct = _   atm instead.09/04 02:10
copumpkinoh, use ?09/04 02:10
copumpkin_ will be yellow, direct = direct will be pink09/04 02:10
xplat_ is for easy things09/04 02:10
copumpkin? will turn a beautiful green09/04 02:10
doliocopumpkin: I'm pretty sure it won't figure that out.09/04 02:10
Eduard_MunteanuAlright.09/04 02:10
copumpkindolio: oh, boo09/04 02:10
copumpkinfine09/04 02:10
copumpkinx : \top09/04 02:10
copumpkinx = _09/04 02:10
dolioagsy or whatever might.09/04 02:11
copumpkinyeah, it definitely will09/04 02:11
xplat? is for when you think agda will need your help09/04 02:11
copumpkinyeah, it won't figure it out09/04 02:11
copumpkinboo09/04 02:11
xplator agsy's help09/04 02:12
copumpkinbut yeah, agsy can figure out most easy stuff09/04 02:12
copumpkinit could do all of augur_'s cases, for example09/04 02:12
copumpkinbut I couldn't get it to case split them all automatically09/04 02:12
augur_whoa what now09/04 02:12
augur_hello09/04 02:12
augur_whats agsy09/04 02:12
Eduard_MunteanuGood so my first goal now looks like   ?0 : Σ Set (λ a → .p a) → (r : _33) → ((a : _31) → a → r) → r09/04 02:12
copumpkinaugur_: an automatic prover for simple holes09/04 02:12
Eduard_Munteanu(the theorem is direct : ∀ { p : Set -> Set } → ∃(λ a → p a) → (∀ r -> (∀ a -> a -> r) -> r   )09/04 02:13
xplatwe're saying you could have proved your stuff by hitting C-c C-c a lot and then C-c C-a a lot09/04 02:13
augur_ah09/04 02:13
copumpkinC-c C-a09/04 02:13
copumpkinit's good if you want to avoid writing out automatic stuff09/04 02:13
copumpkinbut it may not make it as pretty as you would09/04 02:13
copumpkinwhich is why I've been avoiding it in my CT lib :P09/04 02:13
xplati wish emacs undo would undo filling holes :(09/04 02:13
copumpkin(it'll put in fully normalized terms and those are sometimes illegible)09/04 02:14
xplatit's annoying when i end up with something ugly and then i have to edit it outside the hole and reload09/04 02:14
copumpkinyeah09/04 02:14
copumpkinespecially when reloading takes several gigs of ram09/04 02:14
xplater, yes, quite09/04 02:14
copumpkinmmm, http://www.beantownbloggery.com/2011/04/pinkberry-harvard-grand-opening-48.html09/04 02:15
xplati wish i understood more about how agda value/type inference worked too09/04 02:15
xplati never worry too much about it in haskell because the magic almost never fails unless i deliberately do something flashy09/04 02:16
xplatalso i never ended up with a 750KB type in haskell so i didn't worry about a cost model either09/04 02:17
xplatthese things seem a bit more urgent here09/04 02:17
Eduard_MunteanuUh, I'm lost :)09/04 02:17
copumpkinEduard_Munteanu: I think it's time for you to learn Sigma!09/04 02:18
Eduard_MunteanuYeah, I'll go read the lib source code for that first.09/04 02:18
copumpkinwell, conceptually it's a pair such that the second component's type can depend on the value of the first component09/04 02:19
copumpkinwhich is, depending on how you see it, like a regular haskell tuple (if you ignore the dependence) or an arbitrary-arity sum type, or an existential09/04 02:19
Eduard_MunteanuI suppose I have to pattern-match on the pair.09/04 02:19
copumpkindo you understand the three interpretations?09/04 02:20
xplati actually hate the terminology for sigma and pi types09/04 02:20
copumpkinxplat: I think most people do09/04 02:20
copumpkinwhich is why I haven't actually called it a dependent sum :P09/04 02:20
copumpkinoh shit09/04 02:20
Eduard_Munteanucopumpkin: I'm not sure why it's a sum type, looks like a product to me if it's a pair.09/04 02:20
copumpkinEduard_Munteanu: think about (Bool, a) in haskell09/04 02:20
xplatthey either use 'dependent' where they should use 'indexed' or 'sum/product' where they should use 'product/exponential', take your pick09/04 02:21
copumpkinit's sort of like Either a a09/04 02:21
Eduard_MunteanuOh.09/04 02:21
copumpkinEduard_Munteanu: now, why is it Either a a and not Either a b?09/04 02:21
Eduard_MunteanuSo that's where dependence comes.09/04 02:21
xplatEduard_Munteanu: you can consider it as an arbitrary-arity sum where the first element stands for the constructor09/04 02:21
xplatand the second element is the constructor arguments09/04 02:22
Eduard_MunteanuWell since you can't have the same type there unless you write it as a sum type.09/04 02:22
copumpkinyeah, or some notion of a tag09/04 02:22
Eduard_Munteanu*different type09/04 02:22
copumpkinEduard_Munteanu: yeah, but in haskell it can't be a different type because the second component doesn't know what value the Bool has09/04 02:22
copumpkinin agda, it can know that09/04 02:22
copumpkinso Sigma Bool (09/04 02:22
copumpkin\x -> if x then a else b)09/04 02:22
copumpkinis exactly isomorphic to Either a b09/04 02:23
copumpkinhowever, there's nothing special about Bool09/04 02:23
copumpkinyou can use any type you want to index into your Sigma09/04 02:23
Eduard_MunteanuOh, that's a type-level lambda.09/04 02:23
copumpkinyeah09/04 02:23
xplatin agda there really is no type level.  as in types don't have their own level, just their own (hierarchy of )type(s)09/04 02:24
Eduard_MunteanuI thought that was Set.09/04 02:25
copumpkinsure, but there's nothing special about it09/04 02:25
augur_hrmph09/04 02:25
copumpkinSet is just a value in Set109/04 02:25
copumpkinand Set1 is just a value in Set209/04 02:25
augur_so tricky09/04 02:25
Eduard_MunteanuAnd Set_1 kinds.09/04 02:25
xplatSet_1 consists of a bunch of things, including kinds.09/04 02:25
dolioYou can define datatypes that inhabit Set1.09/04 02:26
dolioEven if they don't require it.09/04 02:26
xplatand not all the kinds are in Set\_109/04 02:26
xplatthat's just the first type that has kinds in it09/04 02:27
Eduard_MunteanuHm, it does look hairy.09/04 02:27
copumpkinit's actually very homogeneous and elegant, in many ways09/04 02:27
Eduard_MunteanuI suppose I should stare at ∃ : ∀ {a b} {A : Set a} → (A → Set b) → Set (a ⊔ b)    ∃ = Σ _    now09/04 02:28
xplat(it's also possible to have dependent types and still have a separate type level.  ATS does, for example.  but Agda, Coq, Epigram, and most of the other mathy ones do not.)09/04 02:28
copumpkinEduard_Munteanu: the point of that is that often the function you pass to Sigma reveals completely what type the first component should have09/04 02:28
copumpkinso if I wrote \x -> if x then a else b09/04 02:28
copumpkinit's obvious that x must be a Bool09/04 02:29
copumpkinso Agda can apply that knowledge and save you from writing Bool09/04 02:29
Eduard_MunteanuHm yes, since the function must be total.09/04 02:29
copumpkinwell, just because it has a type09/04 02:29
copumpkinthe function \x -> if x then a else b has type Bool -> Set09/04 02:30
copumpkinso it can extrapolate and figure out that the first argument to Sigma must be Bool09/04 02:30
Eduard_MunteanuI see... so it's ∃ = \x -> Σ Bool x09/04 02:31
copumpkinwell, not quite09/04 02:32
copumpkinfor this particular case it can figure out that it's Bool09/04 02:32
copumpkinbut exists works for any x09/04 02:32
copumpkinI'd call your x f though09/04 02:32
Eduard_MunteanuYes, given I use it on a lambda.09/04 02:32
Eduard_Munteanu∃(λ a → p a)09/04 02:33
copumpkinyeah09/04 02:33
copumpkinwhich can be eta contracted to just exists p09/04 02:33
Eduard_MunteanuSo that makes me think I have    Σ Bool p   there, or just (Bool, p).09/04 02:34
copumpkinwell, yours isn't Bool09/04 02:34
copumpkinyours is Exists Set p09/04 02:34
copumpkinor rather09/04 02:34
copumpkinSigma SEt p09/04 02:34
Eduard_MunteanuOh.09/04 02:35
copumpkinsince p is a function that takes a Set09/04 02:35
Eduard_MunteanuYeah, I couldn't figure what Bool had to do there anyway.09/04 02:35
Eduard_MunteanuSo in my theorem, I can deconstruct that to get 'p' and the type it works on.09/04 02:36
copumpkinyeah09/04 02:36
copumpkinwell, probably :)09/04 02:36
Eduard_Munteanudirect (a, p) = ?    but it complains, I'm unsure how to pattern match in Agda.09/04 02:39
Eduard_MunteanuMaybe try a case expression?09/04 02:40
copumpkindon't stick , to a09/04 02:40
copumpkin(a , p)09/04 02:40
copumpkin(there are no case expressions)09/04 02:41
Eduard_MunteanuThis seems to have worked... direct x = {! case x of (a, p) -> ?!}09/04 02:41
Eduard_MunteanuAh.09/04 02:41
Eduard_MunteanuOk, so now I have a and p. I suppose I can apply p to a to get another Set.09/04 02:43
Eduard_Munteanudirect (a , p) = {! p a!}09/04 02:46
Eduard_MunteanuLooks like Agda hints me I have to put something before that.09/04 02:46
Eduard_Munteanu?0 : ({a' : Set} → .p a' → .r) → .r09/04 02:46
lambdabotMaybe you meant: . ? @ v09/04 02:46
copumpkinuse C-c C-,09/04 02:47
copumpkinit'll tell you what you want in that hole09/04 02:47
copumpkinand what you have09/04 02:47
Eduard_MunteanuAh, looks better now.09/04 02:47
Eduard_MunteanuWhat does stuff like '.p' mean?09/04 02:48
copumpkinmeans it's being used, but you haven't brought it into scope09/04 02:49
copumpkinprobably an implicit09/04 02:49
Eduard_MunteanuAh, thanks.09/04 02:49
Eduard_MunteanuGoal: ({a' : Set} → .p a' → .r) → .r     -- so I suppose I must produce a function that takes a function and return r, looks like an application to me.09/04 02:51
augur_hmm09/04 02:54
augur_things that seem trivial can be so tricky :(09/04 02:55
copumpkinyep!09/04 02:55
augur_x == y -> inl x == inl y and vice versa09/04 02:55
augur_i cant figure out what type to make the relevant function09/04 02:55
augur_i mean, i sort of can09/04 02:55
copumpkinthat is just cong09/04 02:55
augur_but it gives me a yellow background on part of it09/04 02:55
augur_cong?09/04 02:56
copumpkinx == y -> f  x == f y09/04 02:56
augur_ok09/04 02:57
augur_im not sure how to define it tho :(09/04 02:57
copumpkinit's pretty straightforward09/04 02:57
copumpkinwrite its type first09/04 02:57
augur_shush!09/04 02:57
copumpkin:)09/04 02:57
augur_im trying to figure that out :P09/04 02:57
augur_meh09/04 02:57
copumpkinok09/04 02:57
augur_well, that implication isnt true in general tho right09/04 02:58
augur_oh no sure it is09/04 02:58
augur_what am i saying09/04 02:58
copumpkinyeah09/04 02:58
copumpkinvice versa isn't true in general09/04 02:58
copumpkinbut in the case of inl it is09/04 02:58
augur_yeah09/04 02:58
copumpkin(it's true whenever the function is injective)09/04 02:58
copumpkinwhich all constructors are09/04 02:58
copumpkindata constructors09/04 02:58
augur_ya09/04 02:59
augur_man, proving that ++ is trichotomous is a pain09/04 02:59
augur_hm.09/04 03:09
augur_dunno how to define f : inl x == inl y -> x == y09/04 03:10
copumpkinas with everything, try pattern matching then see what happens09/04 03:10
augurhmm09/04 03:14
auguri suppose i have a definition09/04 03:14
augurbut im getting yellow backgrounds on "inl" and "inr"09/04 03:15
augurpresumably because i dont specify what the other set is that is unioned09/04 03:15
copumpkinit doesn't know the other half of the sum09/04 03:15
copumpkinyeah09/04 03:15
augurhow can i express that?09/04 03:15
copumpkinI'd annotate the _==_09/04 03:15
copumpkinwhich is ugly09/04 03:15
augurahh09/04 03:16
copumpkinotherwise, you shouldn't actually need to define a functions for this09/04 03:16
augurey?09/04 03:16
copumpkinwell, maybe you do09/04 03:16
augurmy proof for trichotomy requires that i construct inl x == inl y but i only have x == y09/04 03:16
augurand so forth09/04 03:16
augurer09/04 03:16
auguryeah09/04 03:16
auguror i have to have inl x == inl y -> \bot but i only have x == y -> \bot09/04 03:17
auguretc09/04 03:17
augurno, sorry,other way around09/04 03:17
auguryou get the point :P09/04 03:17
auguri have a goal "(inr x == inr y → ⊥) → x == y → ⊥"09/04 03:18
augurso i have to have some way of defining inr x == inr y -> x == y09/04 03:19
copumpkinwell, not really09/04 03:21
copumpkinthat's a function09/04 03:22
copumpkinf wtf x==y = ?09/04 03:22
copumpkinwhere wtf is the (inr x == inr y → ⊥)  term09/04 03:22
copumpkinand x==y is the x == y term09/04 03:22
copumpkinright?09/04 03:22
augursure09/04 03:22
copumpkinnow, try pattern matching on the x==y09/04 03:22
copumpkin(refl)09/04 03:22
copumpkinyou have now told agda that x == y09/04 03:23
augurhold on what09/04 03:23
copumpkinwhich means that you can trivially construct an inr x == inr x09/04 03:23
Eduard_MunteanuAgda isn't helping me here: http://hpaste.org/45478/exist09/04 03:23
copumpkinsure it is09/04 03:24
dolioHmm, is there a way to put a fixity on syntax?09/04 03:24
augurcopumpkin: i dont follow at all09/04 03:24
copumpkinaugur: well, your x==y term09/04 03:24
Eduard_MunteanuI thought something like f (p a) would do, but it doesn't :/09/04 03:24
copumpkinaugur: its type has a single constructor , right?09/04 03:24
augurcopumpkin: the goal is inside some big obnoxious other thing09/04 03:24
copumpkinEduard_Munteanu: try putting those types together09/04 03:24
copumpkinlook for example at f and p'09/04 03:24
copumpkinaugur: that's fine09/04 03:25
augurcopumpkin: ok...09/04 03:25
auguri dont see how its fine but09/04 03:25
Eduard_Munteanup' : p a   and   f  : {a' : Set} → p a' → .r    so   p' should match the p a'09/04 03:25
copumpkinyou might need a helper function, but you only need one going x == y -> inr x == inr y09/04 03:25
copumpkinwhich is just cong09/04 03:26
augurhow do i only need that09/04 03:26
copumpkinaugur: well, in isolation09/04 03:26
auguroh!09/04 03:26
copumpkinyou need a \bot09/04 03:26
Eduard_MunteanuStrange!09/04 03:26
auguroh oh!09/04 03:26
copumpkin:)09/04 03:26
Eduard_MunteanuThanks copumpkin, f p' does it, I thought I tried it before without success. :/09/04 03:26
auguri can use the x == y to get the inr x == inr y and then apply the first proof of \bot to that!09/04 03:27
auguraha!09/04 03:27
copumpkinEduard_Munteanu: no problem! it gets easier to notice how those context types fit together to get your goal as you go on09/04 03:27
copumpkinor what helper functions (lemmata?) you might need09/04 03:27
copumpkinaugur: yep!09/04 03:27
Eduard_MunteanuThough f (p a) doesn't do it.09/04 03:27
dolioIt would appear not...09/04 03:28
Eduard_MunteanuAlthough   p' : p a09/04 03:28
augurcopumpkin: <309/04 03:28
Eduard_MunteanuWait!09/04 03:28
copumpkinEduard_Munteanu: you're confusing types and their values09/04 03:28
Eduard_MunteanuYeah.09/04 03:28
Eduard_Munteanup' inhabits p a, isn't p a :)09/04 03:29
copumpkinyep!09/04 03:29
xplatwhen the type of types is called Set i almost want to write : as \in09/04 03:29
Eduard_MunteanuHm, I should do the inverse theorem now. I'm a bit afraid though. 'direct' was obvious in Haskell, but 'inverse' took me a while. :)09/04 03:30
augurcopumpkin: but now to go the other way09/04 03:30
xplatEduard_Munteanu: what are you proving again?09/04 03:30
augurgoal: inr x == inr y -> \bot, but i have x == y -> bot09/04 03:30
augur:(09/04 03:30
augurhm!09/04 03:30
augurbut09/04 03:31
xplataugur: for that you need to use injectiveness ...09/04 03:31
Eduard_Munteanuxplat: the conversion formula for existential <-> universal09/04 03:31
copumpkincurry/uncurry!09/04 03:31
copumpkin;)09/04 03:31
augurcopumpkin: was that to me or to Eduard_Munteanu?09/04 03:32
Eduard_MunteanuWait, was that for me, copumpkin?09/04 03:32
augurXD09/04 03:32
copumpkinfor Eduard_Munteanu09/04 03:32
augur:(09/04 03:32
xplatdependent curry/uncurry, yeah09/04 03:32
Eduard_MunteanuWhoa!09/04 03:32
copumpkinthe power of the spices09/04 03:32
xplatbut uncurry is a cospice09/04 03:32
* Eduard_Munteanu is baffled!09/04 03:33
Eduard_MunteanuI can kinda see it now, but I didn't in Haskell.09/04 03:33
Eduard_MunteanuThanks guys!09/04 03:38
copumpkinno problem09/04 03:38
augurstupid internet09/04 03:49
augurgrr09/04 07:14
augurim one stupid function away from having this one clause done09/04 07:29
Eduard_Munteanuo/  I'm having a little trouble proving    inverse : ∀ { p : Set → Set } → (∀ {r : Set} → (∀ {a : Set} → p a → r) → r) → ∃(λ a → p a)09/04 16:23
Eduard_MunteanuI started by doing inverse { p } f = (Bool , ?)09/04 16:24
Eduard_MunteanuBut I can't tell how to fill that hole, i.e. provide something of type 'p Bool'.09/04 16:24
Saizanyou don't know if the 'a' for which you can get a p a is actually Bool09/04 16:25
Saizanin fact, that inverse won't hold constructively09/04 16:25
Eduard_MunteanuYeah, but I don't have any other known Set either. :/09/04 16:25
Eduard_MunteanuBut it worked in Haskell :)09/04 16:26
Eduard_Munteanuinverse :: forall (p :: * → *). (forall r. (forall a. p a → r) → r) → Exists p       inverse f = f MkExists      where    data Exists (p :: * → *) = forall a. MkExists (p a)09/04 16:26
Saizanmh, actually it could09/04 16:27
Saizaninverse f = f (\{a} p -> a , p)09/04 16:27
* Eduard_Munteanu tries09/04 16:27
copumpkinor just _ , p ?09/04 16:28
Eduard_MunteanuThose don't seem to work.09/04 16:31
Eduard_MunteanuSet !=< p (_55 f) of type Set₁ when checking that the expression p ? has type p (_55 f)09/04 16:31
copumpkinoh wait09/04 16:32
Eduard_MunteanuAlso inverse { p } f = f ?  doesn't do either.09/04 16:32
copumpkinthe implicit is in the wrong place09/04 16:32
Saizan(∀ {r : Set} <- too restrictive09/04 16:32
Saizan∃(λ a → p a) : Set109/04 16:33
Eduard_MunteanuHm, yeah Set1 makes sense there lemme see..09/04 16:33
Saizaninverse : ∀ { p : Set → Set } → (∀ {l} {r : Set l} → (∀ {a : Set} → p a → r) → r) → ∃(λ a → p a)09/04 16:34
Saizaninverse f = f (λ x → _ , x)09/04 16:34
Saizanworks09/04 16:34
Saizanwith --universe-polymorphism09/04 16:35
Saizaninverse : ∀ { p : Set → Set } → ((∀ {a : Set} → p a → \bot) → \bot) → ∃(λ a → p a) -- shouldn't be provable instead09/04 16:36
Eduard_MunteanuMmm, it works, thanks. I still have to stare at it a bit.09/04 16:39
Eduard_MunteanuAnd rework my direct theorem to be the same.09/04 16:39
Eduard_Munteanu(ah, that worked with no changes)09/04 16:40
Eduard_MunteanuHm, I can't replace '_' with something explicit, can I?09/04 16:42
Saizanf (λ {a} p → a , p)09/04 16:43
Eduard_MunteanuHm, Agda existentials are hairier to use.09/04 16:45
Eduard_MunteanuWhat's wrong with   trans : ∀ { a, b, c : Set } → (f : a → b) → (g : b → c) → (h : a → c)    ?09/04 17:56
Eduard_MunteanuI get a cryptic parse error on this line.09/04 17:56
copumpkinyou can't name a return value09/04 17:58
copumpkinI think the word you're looking for is compose, too09/04 17:58
Eduard_MunteanuOh.09/04 17:58
Eduard_MunteanuYeah.09/04 17:59
Eduard_MunteanuI should probably drop all those names too.09/04 17:59
copumpkinthe parameter names don't hurt you09/04 17:59
Eduard_MunteanuI initially thought I could write some sort of composition operator in the type.09/04 18:00
Eduard_MunteanuBut it's superfluous.09/04 18:01
* Eduard_Munteanu is trying something sick as open-coding datatypes as functions (functors)09/04 18:16
Eduard_MunteanuMaybe it works.09/04 18:16
Eduard_MunteanuHm, is there an injective reify : ∀ { l : Level } -> (Set l -> Set l) -> Set l   ?09/04 18:38
Eduard_MunteanuI'm looking for some sort of type representations.09/04 18:39
Eduard_Munteanu*sigh* if only there were typeclasses09/04 18:42
copumpkinno, but you can make explicit type representations called universes09/04 18:47
copumpkinwhich are just ADTs representing the structure of the types you want to represent09/04 18:47
copumpkinwith an "interpretation" function that makes the ADT into a real agda type09/04 18:47
copumpkinif you go to ulf's usual agda tutorial pdf, on page 29 you'll find an example of what I'm talking about09/04 18:48
Eduard_MunteanuAh, thanks. The main reason is I want to make something like...09/04 18:50
Eduard_MunteanuList : Set -> (some type representation) × Set09/04 18:51
Eduard_MunteanuBut somehow I want to avoid ADTs. (Because then I'd write my List as an ADT :) )09/04 18:52
Eduard_MunteanuI suppose something less universal like List : Set -> ℕ × Set   might do too.09/04 18:54
copumpkinhmm, I don't understand that at all09/04 19:04
Eduard_Munteanucopumpkin: ok, my understanding is a datatype like those in Haskell consist of a type function * -> * (Set -> Set) and a tag. For example List :: * -> * takes a type 'a' into 'List a'. Now I want to avoid the 'data' syntax and open code such a datatype.09/04 19:08
Eduard_MunteanuSo I figure I can use a product to represent the type function: Set -> <some tag> × Set09/04 19:08
Eduard_MunteanuI haven't got to data (value-level) constructors yet, though.09/04 19:09
Eduard_MunteanuOr is this terribly wrong? :)09/04 19:11
Eduard_MunteanuList a =  ( 1 ,  a )   but I think it has no inhabitants. :/09/04 19:22
Eduard_MunteanuI'd need a higher-level product.09/04 19:23
xplati don't know if all the functionality of 'data' is replaceable, although it might be by abusing abstract modules09/04 19:56
xplatbut i'm not quite sure if what i'm saying applies to what you're trying to do either09/04 19:57
xplat(and maybe if i finished the 'power of pi' section on universes i'd also find that what i am saying is not true, dunno)09/04 19:59
Eduard_Munteanuxplat: well, not replace it wholly, just if I already have products and such.09/04 20:14
xplati'm not sure how you would say List a = ( 1 , a ) in either case09/04 20:16
Eduard_MunteanuThe problem I'm hitting is I can't define   [] : ∀ { l : Level } { a : Set l } -> List a09/04 20:17
Eduard_MunteanuI mean, it doesn't even accept the type sig.09/04 20:17
Eduard_MunteanuBut    List a = ( 1 , a )  alone works.09/04 20:17
copumpkinyou might be interested in http://www.cs.kent.ac.uk/people/staff/sjt/TTFP/ttfp.pdf, around page 10009/04 20:18
copumpkinlook for well-founded types09/04 20:18
Eduard_MunteanuThe '1' there is until I get something better. If I had typeclasses I could say ( getTypeRep a, a )09/04 20:18
copumpkinactually, 17909/04 20:18
Eduard_MunteanuThanks, *looks*.09/04 20:18
xplatEduard_Munteanu: i can't see how a List could be represented as ( getTypeRep a , a )09/04 20:19
xplator even the type of lists of a09/04 20:19
Eduard_MunteanuYes, the type of lists of a.09/04 20:19
xplat( getTypeRep a , a ) isn't a type so it can't have members09/04 20:20
Eduard_MunteanuYeah.09/04 20:20
xplator be the return type of a function09/04 20:20
Eduard_MunteanuWhich makes me wonder if there's a higher-level product, whose values are types.09/04 20:21
xplat× ?09/04 20:21
copumpkinyou can easily just take the product of two types09/04 20:21
copumpkinat any level09/04 20:21
Eduard_Munteanucopumpkin: yeah, but the values in the product should be types themselves09/04 20:21
copumpkinthat's fine09/04 20:21
xplatbut presumably 'getTypeRep a' isn't a type either09/04 20:22
copumpkintake a product of things in Set109/04 20:22
Eduard_Munteanuxplat: but the (,) I'm interested in could take a value and a type into a type I guess.09/04 20:23
Eduard_Munteanu_,_ : N -> Set -> Set09/04 20:24
xplatwell, you could define such a product ... using 'data'09/04 20:24
Eduard_MunteanuHm, that'd be suitable as long as I can use it to define all (many) other datatypes.09/04 20:24
Eduard_Munteanu× itself is a data09/04 20:25
Eduard_Munteanu(through Sigma IIRC)09/04 20:25
* Eduard_Munteanu is surprised the standard lib looks so readable to a beginner :)09/04 20:27
dolioWas [] : ∀ { l : Level } { a : Set l } -> List a your annotation on the constructor in the data?09/04 21:08
dolioBecause if so, it's unsurprising that wouldn't work.09/04 21:09
Eduard_Munteanudolio: sorry, I was away. Yeah, but I also tried [] : ∀ { a : Set } -> List a09/04 22:34
dolioThat's sort of existentially quantifying over Set, which isn't likely what you wan to do.09/04 22:36
dolioAnd existential universe polymorphism simply doesn't work.09/04 22:36
dolioIt isn't really existential, because the variables appear in the result type, but you parameters and indices are actually different in Agda.09/04 22:37
dolioUnlike in Haskell.09/04 22:37
Eduard_MunteanuMm, even if I want it for simple types? Like lists over ints, bools etc. ?09/04 22:38
Eduard_MunteanuYeah, I can tell they're a bit like existentials because my tupling looks a lot like how existentials are defined in Agda.09/04 22:39
dolioThere's no reason to quantify in each constructor over things that are uniform in the result type of each constructor.09/04 22:40
doliodata List {l} (A : Set l) : Set l where [] : List A ; _::_ : A -> List A -> List A09/04 22:40
Eduard_Munteanudolio: hm maybe you misunderstood me. I know how to define a list "normally", but I wanted to see if I can avoid using 'data' declarations completely (well, except for products and such).09/04 22:41
dolioAnd in fact, quantifying over Set l in the constructor will increase the size of the datatype.09/04 22:41
dolioOh.09/04 22:42
Eduard_MunteanuBasically, I'm looking to define the type operator as a normal function, and value-level constructors similarly.09/04 22:43
Eduard_MunteanuList : Set -> ℕ × Set    List a =  ( 1 ,  a )09/04 22:43
Eduard_MunteanuI picked ℕ and 1 arbitrarily so I can "tag" the result.09/04 22:44
dolioWhy 1?09/04 22:44
Eduard_MunteanuDoesn't really matter. If I had typeclasses I probably could obtain a type representation for the input set.09/04 22:44
dolioAnyhow, Nat x Set doesn't have elements, so that's going to be a problem.09/04 22:44
Eduard_MunteanuYeah, I suppose I need to define my own datatype for that, so I can have a "multi-leveled" product.09/04 22:45
Eduard_Munteanui.e. one whose values are types.09/04 22:45
copumpkinI'm still confused about what that even means09/04 22:45
dolioYou can't define List straight-forwardly because it's defined as a recursive equation.09/04 22:45
dolioList a = 1 + a * List a09/04 22:45
dolioBut that isn't valid.09/04 22:45
Eduard_Munteanudolio: List here is just the type, so far.09/04 22:46
dolioAlthough you may be able to do that via some of the Agda extensions. I forget what the right one is called.09/04 22:46
dolioYou can define vectors by recursion on the natural parameter, though.09/04 22:46
Eduard_MunteanuBTW, are Agda's types isorecursive? Or can we have equirecursive types too?09/04 22:46
dolioVec zero a = () ; Vec (suc n) a = a * Vec n a09/04 22:47
dolioAnd then you can quantify over the natural to get lists.09/04 22:47
Eduard_MunteanuAh, I see.09/04 22:47
dolioAgda's types aren't recursive at all, in the general recursive Haskell sense.09/04 22:48
Eduard_MunteanuWell, can't I say the List datatype is recursive? It surely looks like.09/04 22:49
dolioYou could. A more technical name might be inductive.09/04 22:50
dolioThere are also coinductive types.09/04 22:50
dolioHaskell essentially has fixed points of arbitrary functors.09/04 22:51
Eduard_MunteanuSo I guess they're isorecursive since List a ~ 1 + a * List a ~ ...09/04 22:51
dolioAnything that can be written with +, *, -> and previously defined types.09/04 22:51
dolioAgda has a pared down collection.09/04 22:52
Eduard_MunteanuOh, so you mean Agda's Mu would be restricted.09/04 22:52
dolioYes.09/04 22:52
doliomu X. X -> T does not exist.09/04 22:52
* dolio should get going.09/04 22:52
Eduard_MunteanuThanks. I'll try to write my own Mu and maybe solve this puzzle :)09/04 22:53
copumpkinI don't think you'll have much luck, unless you operate on a restricted universe09/04 22:53
Eduard_MunteanuMm, I'd be happy if those Lists could be defined on a subset of types, like those in Set.09/04 22:54
augurcopumpkin: :(09/04 22:54
copumpkinaugur?09/04 22:55
copumpkinEduard_Munteanu: the list can be _over_ any type09/04 22:55
copumpkinbut your Mu can't be09/04 22:55
auguri cant figure out how to prove a three-clause xor :(09/04 22:56
copumpkinwhat's that?09/04 22:56
copumpkinI need to go out in a couple of minutes09/04 22:56
augurey?09/04 22:56
augurk :\09/04 22:56
Eduard_MunteanuWhat's a three-clause XOR?09/04 22:57
augurP xor Q xor S?09/04 22:57
Eduard_MunteanuWhat do you want to prove about it?09/04 22:58
augurwell, its part of a trichotomy proof09/04 22:58
Eduard_MunteanuOh.09/04 22:59
augurx < y xor y < x xor x == y09/04 22:59
copumpkinoh09/04 22:59
copumpkinwhere are you having trouble then?09/04 22:59
augurits a complicated proof, and i keep coming up with crap like x == y -> \bot, and all sorts of crap09/04 23:00
augurand i dont know how to prove them :(09/04 23:00
augurccc, doesnt help09/04 23:00
augur:(09/04 23:00
copumpkincan I see some code?09/04 23:01
augurhttp://hpaste.org/45492/trich_junk09/04 23:02
Eduard_MunteanuWhy don't you use the standard library and do imports? :/09/04 23:03
copumpkinyou're going to want a with clause here, I think09/04 23:03
auguri have my reasons!09/04 23:03
augurcopumpkin: yeah, i had withs over p1 {x} {y} and p2 {x} {y}09/04 23:04
copumpkinyeah09/04 23:04
augurill expand it out to where i had it before and show you later09/04 23:04
copumpkincool09/04 23:07
copumpkinit looks rather hairy but not too bad09/04 23:07
copumpkinyou'll probably need some helper functions09/04 23:07
auguri have cong, and uncong for sums09/04 23:09
copumpkinaha09/04 23:23
copumpkinaugur: your uncong is too specific09/04 23:23
copumpkinyou don't want X + X09/04 23:23
copumpkinyou want X + Y for all y09/04 23:23
augurok09/04 23:23
copumpkinhttp://hpaste.org/paste/45492/one_clause_done#p4549609/04 23:24
copumpkinwith suitable helper functions it wouldn't have to be this ugly09/04 23:25
copumpkinbut I was in a rush :)09/04 23:25
copumpkinI added either as a helper09/04 23:25
copumpkinalso functions proj1 and proj2 to get shit out of an \and09/04 23:25
copumpkinand made your uncong inl and inr more general09/04 23:25
copumpkinwhy do you have both \and and \x ?09/04 23:26
copumpkinthey're more or less isomorphic09/04 23:26
Eduard_MunteanuHrm, I'm not sure I get datatype declarations, they seem a bit more than GADT-ish :/09/04 23:31
augurcopumpkin: true! i intended on factoring those out09/04 23:31
copumpkinEduard_Munteanu: they are like dependent GADTs09/04 23:31
Eduard_Munteanudata Functor (n : ℕ) (a : Set) : Set where _⊗_ : n -> a → Set     seems to complain09/04 23:32
copumpkinhowever, you need to explicitly separate out the parts that you can refine from the ones you can't09/04 23:32
copumpkinunlike haskell GADTs09/04 23:32
Eduard_MunteanuYeah, I don't really understand where ':' should go.09/04 23:32
copumpkinbasically, a type parameter (on the left of the colon) never changes across all constructors09/04 23:32
copumpkina type index is allowed to change across constructors09/04 23:32
copumpkinthe parameters are in scope for all constructors, so you don't need to quantify09/04 23:32
copumpkinan index you need to introduce yourself09/04 23:33
copumpkinthe type index is what's on the right of the colon09/04 23:33
Eduard_MunteanuBut could I have it on the lefT?09/04 23:33
Eduard_MunteanuThe index.09/04 23:33
copumpkinnot if you want it to change09/04 23:33
Eduard_MunteanuI don't want it to.09/04 23:33
Eduard_Munteanu(here)09/04 23:33
copumpkinthen put it on the left09/04 23:33
copumpkin_⊗_ : n -> a → Set09/04 23:34
copumpkinthat doesn't make sense though09/04 23:34
copumpkinn is a number09/04 23:34
copumpkinit has no values09/04 23:34
Eduard_MunteanuHrm.09/04 23:34
copumpkinmaybe you meant _⊗_ : ℕ -> a → Set09/04 23:34
copumpkinI dunno09/04 23:34
Eduard_MunteanuLemme rethink it :)09/04 23:34
copumpkinsince a is of type Set, it does itself have values, so you can use it there09/04 23:35
Eduard_MunteanuYeah, I suppose I don't need to expose the index in the type itself.09/04 23:35
augurcopumpkin: should i just replace all \and with \x or should i use \and for mnemonic reasons but make it an alias?09/04 23:38
copumpkinhmm, I'd just use one, don't really care which. If you have an alias it won't show up in any of your types09/04 23:39
copumpkinbecause agda will "see through" it09/04 23:39
augurright09/04 23:39
augurmeh. ill just use \x and +09/04 23:39
xplatEduard_Munteanu: you have to remember that with a data declaration you are declaring at least two functions09/04 23:44
xplatEduard_Munteanu: one function is a type constructor that returns a type, the other(s) is/are data constructors that return values of that type09/04 23:45
Eduard_Munteanuxplat: you mean the type function and the constructor?09/04 23:45
Eduard_MunteanuAh.09/04 23:45
copumpkinxplat: assuming you have any constructors :P09/04 23:46
xplatnot every data constructor has to be able to return a value of any type in the image of the type constructor, but they all can only return values of types in that image09/04 23:46
xplatcopumpkin: i was ignoring that case :)09/04 23:47
xplatEduard_Munteanu: it looked like in your Functor type you were getting the type constructor and data constructor a little mixed up09/04 23:47
Eduard_Munteanuxplat: well, it's hell to keep track of it, because I want my constructor to return a type :)09/04 23:48
copumpkinyou sound like you're trying to do something agda won't let you do09/04 23:49
copumpkinyou can't make your types themselves be types09/04 23:49
xplatyou can't have a data constructor return a type09/04 23:49
copumpkinor rather09/04 23:49
Eduard_MunteanuNo?09/04 23:49
copumpkinyour values, themselves be types09/04 23:49
Eduard_MunteanuI mean, can't you have higher-level values?09/04 23:49
xplatall the types that have types as values are predefined09/04 23:49
Eduard_MunteanuYeah, that's what I mean.09/04 23:49
copumpkinSet n is a sort09/04 23:49
xplatyou can't create types of your own with types as values09/04 23:49
Eduard_MunteanuI wanted my constructor to take a number, a set and return another set represented by a pairing between the number and the former set.09/04 23:50
copumpkin:O09/04 23:51
Eduard_MunteanuOr take it another way... whatever value I get by applying a constructor, it has to be "inhabitable" :)09/04 23:52
Eduard_MunteanuAn inhabited pair.09/04 23:52
xplatthe Set types are sort of like open variants in that you can create your own type constructors that return Sets.  (but you can't pattern match on them.)09/04 23:52
Eduard_MunteanuOk, this worked: data Functor (a : Set) : Set₁ where  _⊗_ : ℕ -> Set -> Functor a09/04 23:53
xplathowever, your type constructors always must return Sets, and your data constructors cannot return types.09/04 23:53
Eduard_MunteanuList : (a : Set) -> Functor a      List a = 1 ⊗ a09/04 23:53
copumpkinokay, but now what? :P09/04 23:53
Eduard_MunteanuHm.09/04 23:53
copumpkinI still don't understand09/04 23:54
xplatif you want to have a datatype that represents types, you have to explicitly supply an interpretation function that maps your universe of types into Set (or some Set l)09/04 23:55
Eduard_MunteanuI hoped to be able to write [] : ∀ (a : Set) -> List a09/04 23:55
Eduard_MunteanuBut it complains on something as simple as 'List a' there :/09/04 23:55
Eduard_MunteanuRather cryptic.09/04 23:55
xplatEduard_Munteanu: because List a is not a type09/04 23:55
Eduard_MunteanuBut 'List a' gives a 'Functor a' which belongs to Set\_109/04 23:56
xplatEduard_Munteanu: Functor a belongs to Set\_1, but values of Functor a belong to Functor a09/04 23:57
Eduard_MunteanuYes, so shouldn't they be "normal" (Set) types?09/04 23:57
xplatEduard_Munteanu: you seem to be suffering from a confusion about what Set\_n are09/04 23:58
xplatit's not like the elements of Set\_0 are types, the elements of Set\_1 are kinds, the elements of Set\_2 are sorts of kinds, etc.  banish that from your mind.09/04 23:59
Eduard_MunteanuSet -> Set   \in   Set\_109/04 23:59
Eduard_MunteanuOh.09/04 23:59
xplatthe elements of Set\_0 are types, the elements of Set\_1 are larger types (in the set-theory version of large), the elements of Set\_2 are yet larger types.09/04 23:59
Eduard_MunteanuI suspect they're larger than just that, but that shouldn't be a problem, should it?09/04 23:59
--- Day changed Sun Apr 10 2011
Eduard_MunteanuYeah, in the sense of "set of all sets" larger.10/04 00:00
Eduard_Munteanu*set of all smaller sets10/04 00:00
xplatit's easy to get confused, because all the kinds are in Set\_1 and higher.  but they're not there because they're kinds, they're there because kinds are large.10/04 00:00
xplatanyway, the upshot is that agda doesn't have user-defined kinds in the sense you want.10/04 00:03
Eduard_MunteanuI noticed I can't have my datatype be a Set -> Set.10/04 00:03
Eduard_MunteanuThat'd narrow it down to a specific set of kinds.10/04 00:03
xplatyou can define things that would be in the kind level in other languages, but you can't define things like haskell's * and ? and ?? that give kinds their 'kindness'10/04 00:04
xplati guess you could call those 'base kinds' -- kinds whose elements are types.  you cannot define those.10/04 00:05
Eduard_MunteanuIs there a specific reason for this restriction?10/04 00:05
Eduard_Munteanu(in the sense, can I expect an extension to allow me that (in the future) ? )10/04 00:05
xplatyou only get the Set hierarchy of base kinds that is built in10/04 00:05
Eduard_MunteanuSo I guess '->' is still hella special in Agda too.10/04 00:06
Eduard_MunteanuAs in it's a special product.10/04 00:07
xplatin some ways -> is less special in Agda than in haskell, but still pretty special, yes.  but i don't think it's special in the way you are thinking right now.10/04 00:08
Eduard_MunteanuHm, maybe I can use '->' directly to make my List, though the values of that are hairy.10/04 00:08
Eduard_MunteanuDamn... List : (a : Set) -> (ℕ -> Set)  List a = const a    but [] still doesn't work10/04 00:10
xplati mean, you can give -> a type (well, i should say ()-> or {}-> because they're different), even if you can't write a data constructor for it without using -> itself10/04 00:10
xplatEduard_Munteanu: ℕ -> Set is still not a type10/04 00:10
Eduard_MunteanuUh, yeah :(10/04 00:11
xplater, is still not a base kind10/04 00:11
* Eduard_Munteanu notices 'lift'10/04 00:11
xplatsorry, you seem to be having enough trouble keeping track of these levels without my mixing them up too :(10/04 00:12
Eduard_Munteanu(nah, useless)10/04 00:12
Eduard_MunteanuYeah, if you understand what I want to do, I kinda have to go through some hoops (supposing it's possible).10/04 00:12
xplatEduard_Munteanu: i think you should read 'the power of pi', it shows how to do the closest thing to what you want in coq and the basics are transferrable10/04 00:15
Eduard_MunteanuThanks, I'll have a look.10/04 00:16
Eduard_MunteanuHm, Power of Pi seems to have some Agda code in there.10/04 00:17
augurcopumpkin: <310/04 00:28
auguryou're wonderful :(10/04 00:28
augurhelp me cobi wan pumpkoni, you're my only hope10/04 07:44
augurthat is to say, copumpkin :P10/04 07:45
augurwhy the hell am i getting scope errors when importing something10/04 09:29
augurit works fine by itself but when i import it i get some crazy scope issue10/04 09:30
Saizandid you open it?10/04 11:02
augurSaizan: that for me?10/04 11:27
Saizanyep10/04 11:29
augurindeed i opened it10/04 11:30
augurthats whats giving me the error! :(10/04 11:30
Saizanyou need to paste the error and the code if you still have this problem, then10/04 11:30
augurya10/04 11:30
augurhttp://hpaste.org/45527/import_error10/04 11:31
Saizancode?10/04 11:34
augurfor which? Relations?10/04 11:34
Saizanboth10/04 11:34
Saizanbut i think the problem is in Relations10/04 11:34
Saizanyou probably have some yellow there, and you can't import such modules10/04 11:35
augurannotated10/04 11:35
augurrelations has no yellow10/04 11:35
auguri just split my original source code into seperate files10/04 11:36
augurthe original code checked10/04 11:36
Saizanyeah, ok10/04 11:37
augurbut the split code fails on relations10/04 11:37
Saizanbut when you load Relations alone10/04 11:37
Saizandoes it print anything in the *Agda Information* buffer?10/04 11:37
augur(suc (\/ (Set .n) (\/ (Set .n) (Set (suc ℓ))))) = (Set (suc (.n ⊔ suc ℓ)))10/04 11:37
augur(\/ (Set .n) (\/ (Set .n) (Set (suc ℓ)))) = (Set (.n ⊔ suc ℓ))10/04 11:37
augur(suc (\/ (Set .n) (\/ (Set .n) (Set (suc ℓ))))) = (Set (suc (.n ⊔ suc ℓ)))10/04 11:37
augur(\/ (Set .n) (\/ (Set .n) (Set (suc ℓ)))) = (Set (.n ⊔ suc ℓ))10/04 11:37
Saizanthere.10/04 11:37
augurwhat is that??10/04 11:38
Saizanthose are unsolved constraints10/04 11:38
augurim not sure what that means10/04 11:39
Saizanequalities the typechecker needs to let your code typecheck, but that couldn't be proved nor disproved10/04 11:40
augurhm10/04 11:40
augurbut why did it check in the original code?10/04 11:41
Saizanare you sure they weren't there in the original code?10/04 11:41
Saizana possibility is that later code helped solving them10/04 11:41
Saizanthat can only happen within a module though, it doesn't work if you split it up10/04 11:41
auguroh, i guess it didnt check maybe?10/04 11:42
augurhmm10/04 11:42
augurhow can i see where this constraint is coming from?10/04 11:43
Saizani don't know10/04 11:43
augur:\10/04 11:43
auguraha!10/04 11:44
augurfound one place10/04 11:44
Saizan(are you using naturals as universe levels?)10/04 11:45
auguryes10/04 11:45
augurshould i keep them separate??10/04 11:45
Saizani don't think it matters much10/04 11:46
Saizanonly aesthetically :)10/04 11:46
auguraha!10/04 11:46
auguri found the error10/04 11:46
auguri didnt have {-# BUILTIN LEVELMAX _⊔_ #-}10/04 11:47
augurin my naturals file10/04 11:47
augurall good now :)10/04 11:47
augur<310/04 11:47
Saizannice10/04 11:50
augurgrr10/04 12:09
augurnow im getting yellow where the was none before10/04 12:09
augurfor something that shouldnt be yellow10/04 12:09
auguroh i guess not10/04 12:11
augurhmm!10/04 12:11
* Eduard_Munteanu thinks of writing a dependently-typed array for the standard lib.10/04 19:10
Eduard_MunteanuAgda could use some more programming-oriented goodness.10/04 19:11
* Eduard_Munteanu starts by writing a ST binding.10/04 19:37
Eduard_MunteanuI wonder how / if I need to tell Agda to call Haskell with Rank2Types enabled.10/04 19:37
Eduard_Munteanu:t newSTRef10/04 19:39
lambdabotforall a s. a -> ST s (STRef s a)10/04 19:39
Eduard_MunteanuBTW, which style is prefered here?   return : ∀ {A} → A → IO A10/04 19:41
Eduard_MunteanuAs I understand there's no distinction between lowercase/uppercase in Agda.10/04 19:41
Eduard_MunteanuSo I'd like to use lowercase stuff, instead of that ^10/04 19:42
Eduard_Munteanu:t writeSTRef10/04 19:55
lambdabotforall s a. STRef s a -> a -> ST s ()10/04 19:55
Eduard_MunteanuHrm. I wonder how to deal with functions containing typeclasses in their types.10/04 20:04
Eduard_MunteanuCan I do some sort of trick like postulate Typeclass : Set, Member : Typeclass etc. ?10/04 20:20
Eduard_Munteanuwhere Member is also Member : Set ?10/04 20:21
dolioUpper-case is used for set-valued terms.10/04 20:28
dolioA : Set, F : A -> Set, etc.10/04 20:31
Eduard_MunteanuOh.10/04 20:32
Eduard_MunteanuPerhaps I should just use Int-valued indexes into the array.10/04 20:36
xplatEduard_Munteanu: the proper replacement for a typeclass is a (usually implicit) argument containing the 'evidence' -- that is, a record of all the stuff that would go in the instance declaration10/04 22:01
xplater, for a typeclass context10/04 22:02
xplatand it should come after the foralls for the types it's constraining, of course10/04 22:03
npouillardxplat: hum having them implicit seems like a burden since Agda will almost never pick it for you10/04 22:04
xplatnpouillard: yeah, sometimes you don't want it to be implicit.  really depends on how you use it.10/04 22:05
npouillardAnd I think his problem comes from the fact he want to import these function from haskell via the FFI10/04 22:05
xplatsometimes you want it as a module parameter because you will rarely use multiple instances close together.  sometimes you want it as an explicit parameter, sometimes implicit...10/04 22:05
xplatnpouillard: OH.  hm, no idea how to use that :(10/04 22:05
npouillardxplat: However in a few days a magic feature might appear in Agda...10/04 22:06
xplatnpouillard: so i've heard10/04 22:06
xplati wonder if it will turn out well or will end up as 'just what we need, a third kind of functionspace'10/04 22:06
xplati mean, it sounds like a good idea, but it's always hard to predict how ideas turn out when you throw them into large scale use10/04 22:17
xplatmaybe i would be less uncertain if i'd already used it myself though ;)10/04 22:17
xplatmain thing i worry about is will people get a good intuition for which functionspace to use or will they end up picking by wild guess ...10/04 22:19
xplatwhich sometimes seems like it happens enough already with implicit/explicit :(10/04 22:20
starcloudedhello everybody10/04 22:22
Eduard_Munteanuxplat: thanks10/04 22:50
copumpkinnpouillard: what magic feature?10/04 22:52
copumpkinoh10/04 22:52
copumpkinthe automatic implicit resolution with {{}}10/04 22:53
augurcopumpkin! \o/10/04 22:55
copumpkinyo10/04 22:55
Eduard_MunteanuSo this record of stuff from the instance is actually part of the FFI API/ABI?10/04 22:56
augurcopumpkin: care to look at some code? :x10/04 22:56
copumpkinquite tired, but sure10/04 22:56
augurah ok nevermind then10/04 22:56
copumpkinnah, go ahead10/04 22:56
Eduard_MunteanuI wonder whether it's better to just move this thing out of Agda into a Haskell module, I mean the part that does the unsafe array accesses.10/04 22:59
augurhttp://hpaste.org/paste/45552/linearity_annotation10/04 22:59
augurlinear-++ should be of type LinearOrder (dgx ++ dgy), which means it needs to be of type Transitive (digraph-rel (dgx ++ dgy)) ∧ Trichotomous (digraph-rel (dgx ++ dgy))10/04 23:00
augurso a conjunction, but, it wont accept a conjunction as proof :(10/04 23:01
copumpkinwhat's it say?10/04 23:01
augurif i type (? , ?) as the goal, it just says it cant be refined.10/04 23:04
augurif i just type it on the right of the = it says10/04 23:04
augur/Users/darryl/School Work/Maryland/Algebraic Syntax/LinearOrderingsAndConcatenation.agda:60,28-33 _879 dgx p1 dgy p2 × _880 dgx p1 dgy p2 !=< LinearOrder (dgx ++ dgy) of type Set .n when checking that the expression ? , ? has type LinearOrder (dgx ++ dgy)10/04 23:04
copumpkinjust type C-c C-r in the goal without putting anything in10/04 23:05
augurno introduction forms found :(10/04 23:05
copumpkinoh10/04 23:06
copumpkinyou need a with block on the same linearorder term, or to make Digraph into a record10/04 23:06
copumpkinI think10/04 23:06
augurhm10/04 23:07
xplatwhat i can't believe is that at this point i still don't get with blocks at all10/04 23:08
copumpkinaugur: the point is that in LinearOrder you _match_ on the constructor of digraph to get Transitive _<_ ∧ Trichotomous _<_10/04 23:09
augurhm hm10/04 23:09
copumpkinfor all it knows, that constructor isn't always even possible (say if it's Fin 0 or something)10/04 23:09
copumpkinwith a record, you're saying that it can always be constructed10/04 23:09
copumpkina with block on the digraph that you feed your linear order (dgx ++ dgy)10/04 23:10
copumpkinand then matching on that with result10/04 23:10
copumpkinwould tell it that dgx ++ dgy evaluates to a digraph10/04 23:10
copumpkinso it'll evaluate your goal further10/04 23:10
copumpkinand let you construct it10/04 23:10
copumpkinthat may be more of a pain though, so I'd just go with the record approach10/04 23:10
copumpkinmake sense?10/04 23:16
npouillardcopumpkin: yes, I meant the implicits non-canonical arguments {{...}}10/04 23:20
copumpkincool10/04 23:20
copumpkinI look forward to that10/04 23:20
npouillardthey would have a limited computation power to avoid being mis-used, looks pretty nice anyway10/04 23:22
copumpkinyeah10/04 23:22
copumpkinno transitive "instances"10/04 23:22
copumpkinbut that's fine10/04 23:22
npouillardexperience/usage will tell10/04 23:23
augurcan i pattern match on records?10/04 23:26
auguraha! seems i can10/04 23:26
Eduard_MunteanuHow do I interface with Haskell Ints?10/04 23:27
Eduard_MunteanuI mean, COMPILED_DATA seems awkward to use there.10/04 23:27
Eduard_MunteanuAnd I'd like to convert naturals to Int.10/04 23:27
auguroh no i cant10/04 23:28
augur:(10/04 23:28
copumpkinyou can10/04 23:32
copumpkinyou can give them constructors10/04 23:32
augurit didnt work when i tried10/04 23:38
auguri did TotalOrder (record { carrier = X ; edges = _<_ }) and it failed10/04 23:38
auguraha, i can use the constructor thingy in record to define my own constructor and that works10/04 23:41
augurok thats good10/04 23:41
augurhm10/04 23:44
augurhow can i make the carrier part of the digraphs type?10/04 23:44
auguroh, i guess i dont need to10/04 23:46
copumpkinit can be almost exactly what you have now, except a record10/04 23:47
augurrecords are awesome!10/04 23:48
copumpkinyep10/04 23:48
copumpkinall glory to the hypnorecord10/04 23:49
Eduard_MunteanuBzzzzzzzzzzt!10/04 23:50
Eduard_MunteanuDang, and I don't thing Agda's got a BUILTIN for Int, does it?10/04 23:51
Eduard_Munteanu(which may or may not match the Haskell one)10/04 23:51
Eduard_MunteanuMaybe I should make a Haskell peano, make it an Ix and translate N to that.10/04 23:52
Eduard_MunteanuIdeas?10/04 23:52
copumpkinI dunno10/04 23:53
copumpkinnever really interfaced with haskell10/04 23:53
Saizani think there's some way to get to haskell's Int and Integer10/04 23:54
Eduard_MunteanuA-ha!   http://wiki.portal.chalmers.se/agda/uploads/Main.Libraries/SYSTEM.agda10/04 23:56
Saizanhttp://wiki.portal.chalmers.se/agda/pmwiki.php?n=Docs.FFI10/04 23:57
Eduard_MunteanuSaizan: well yeah I looked at that, but COMPILED_DATA wants constructors :/10/04 23:58
SaizanCOMPILED_TYPE10/04 23:59
--- Day changed Mon Apr 11 2011
Eduard_MunteanuHm, but I thought COMPILED_TYPE only brought in the type itself in scope.11/04 00:00
Eduard_MunteanuThat SYSTEM.agda thingy seems to rely on some builtins too.11/04 00:01
augurnow my other proofs fail :(11/04 00:01
auguri need sleep11/04 00:04
augurno!11/04 00:09
augurcant sleep yet!11/04 00:09
augurmust solve this!11/04 00:09
auguror watch another TNG!11/04 00:10
augurONE OR THE OTHER11/04 00:10
augurMAYBE BOTH11/04 00:10
xplatnpouillard: why is it called 'non-canonical' anyway, i was curious about that11/04 00:20
Eduard_Munteanuaugur: Star Trek?11/04 00:23
auguryes11/04 00:23
Eduard_MunteanuSadly, I've seen all of TNG, AFAICT.11/04 00:23
augurim working on doing that11/04 00:23
augurim currently angry at how incompetent riker/the writers are11/04 00:23
Eduard_MunteanuHeh, Riker has always been a bit of a dumb character.11/04 00:24
augurtheres a waste ship radiating some planet11/04 00:24
augurand they have to get it away from the planet, right11/04 00:25
augurbut picard and the kid crashed11/04 00:25
augurso11/04 00:25
augurquandary!11/04 00:25
augurthe plan is to push the barge into the sun11/04 00:25
xplatcrashed where?11/04 00:25
augurand then theyll go rescue picard11/04 00:25
augurbut thats totally unnecessary11/04 00:25
augurthey can just push it away from the planet on some random parabolic heading11/04 00:25
augurset the construction module to continuously fly it out11/04 00:25
augurleave a sublight shuttle behind to control it11/04 00:25
augurand then they can go to rescue picard11/04 00:25
xplataugur: sure, that would solve the problem, but it wouldn't look cool11/04 00:26
xplataugur: starfleet is all about style11/04 00:26
augurofcourse not11/04 00:26
augurwhich is why im lamenting the writing11/04 00:26
augurthey cant write a decent fraking story!11/04 00:26
Eduard_MunteanuAnyway, TNG's always been smarter than the Cap'n Kirk one or the Archer thingy, I think.11/04 00:27
Eduard_MunteanuThe one with Kirk and Spock is just plainly stupid (and funny) at times.11/04 00:27
xplatSpock's Brain!11/04 00:28
augurgod i hate this show11/04 00:52
auguralso11/04 00:53
auguri cant figure this stuff out11/04 00:53
augurnow that ive made digraphs into records, nothing works!11/04 00:53
augurwell, trichotomous doesnt work11/04 00:53
starcloudedhello everybody11/04 00:54
augurhello11/04 00:55
starcloudedI am trying to create a term for this type concatW : ∀ {a} {A : Set a} →         List (List A) → List A → List A11/04 00:58
WHARRGARBLthat type doesn't really say much about what it's supposed to do11/04 00:59
WHARRGARBLconcatW _ _ = []11/04 00:59
* WHARRGARBL runs11/04 00:59
starcloudedI am having problems definig the nonempty case11/04 00:59
WHARRGARBLwhat is the List A for?11/04 01:00
WHARRGARBLI assume the List (List A) is meant to be concatenated11/04 01:00
starcloudedI have to construct two examples, the fisrt example using a weak specification and the second example using strong specification11/04 01:01
starcloudedyes WHARRGARBL is for concatenate11/04 01:02
WHARRGARBLwhat is the second parameter for?11/04 01:02
starcloudedis the other element I want to concatenate with11/04 01:03
WHARRGARBLso can't you just do concatW xss xs = concat xss ++ xs ?11/04 01:04
starcloudedthanks WHARRGARBL11/04 01:10
xplatit seems a little strange to have a function especially to add a last element to lists of lists but that doesn't work on regular lists11/04 01:25
WHARRGARBLdude this is snoc + concat11/04 01:25
WHARRGARBLpretty awesome11/04 01:25
xplatoh, hm11/04 01:26
xplatwait, what?!11/04 01:26
WHARRGARBLconcat xss ++ xs == concat (xss snoc xs)11/04 01:27
WHARRGARBLI'd hope11/04 01:27
xplatbrain and brain!  what is brain?!11/04 01:27
WHARRGARBLWHARRGARBL11/04 01:28
WHARRGARBLmaybe I'll take a break from the ridiculous memory-gobbling monster descartes and make some commas11/04 01:56
WHARRGARBLsince that should be fairly straightforward11/04 01:56
WHARRGARBLI see, http://snapplr.com/4ar211/04 02:14
starcloudedwhat is the difference between list and colist?11/04 02:46
WHARRGARBLlist must be finite, colist can be infinite11/04 02:47
Eduard_Munteanustarclouded: you might want to look up codata and coinductive types11/04 02:48
jsilvazumsg starcluded lk11/04 02:55
jsilvazuq11/04 03:02
Eduard_Munteanujsilvazu: um?11/04 03:02
Eduard_MunteanuAre there any blogs / papers on interesting stuff done in Agda? I mean, stuff like Power of Pi.11/04 03:11
starcloudedanyone knows some documentation about strong specification in any basic algebra?11/04 03:46
coWHARRGARBLnot sure what you mean by that11/04 03:47
starcloudedI need a example about strong specification11/04 03:49
coWHARRGARBLif you don't say what you mean it's hard to give you an example11/04 03:52
xplatthere are really two differences between list and colist11/04 04:46
xplat1) colists can be infinite, lists are always finite11/04 04:47
xplat2) the termination check for functions on colists is different from the one for lists11/04 04:47
xplatbecause functions that terminate on lists might not terminate on colists11/04 04:48
xplatand contrariwise functions that successfully give colist results might not give list results11/04 04:49
xplatso a function from lists to lists, for example, has to eat a cons at least as often as it spits a fixed number of conses out11/04 04:51
xplatbut a function from colists to colists has to spit out a cons at least as often as it eats a fixed number11/04 04:51
xplater, i was just talking to the air, wasn't i11/04 04:53
xplat^_^;11/04 04:53
coWHARRGARBLI read it!11/04 04:53
coWHARRGARBLbut you probably didn't intend it for me :(11/04 04:53
xplatcoWHARRGARBL: yeah, i kind of figured you already knew that11/04 04:54
xplatabout termination checking, i mean11/04 04:55
coWHARRGARBLyep, although I didn't think to write it :)11/04 04:55
dolioWhat's with all the names?11/04 05:03
copumpkinsorry :( in a silly mood11/04 05:04
djahandarieHe's trying to evade the authorities11/04 05:14
npouillardxplat: we would like to find a better name for it, but the with implicit arguments a term is picked when no other (modulo conversion) could type-check11/04 07:02
npouillardwith the non-canonical ones, there could be more than one, but there is only one in scope.11/04 07:03
* Eduard_Munteanu conjures up some fake lists (ADTs)11/04 13:22
Eduard_Munteanuhttp://hpaste.org/45570/fake_lists11/04 13:22
Eduard_MunteanuI wonder if I can do anything with them.11/04 13:22
kosmikusEduard_Munteanu: without any form of eliminator, I doubt it11/04 13:40
Eduard_MunteanuYeah, I just ran into problems. :)11/04 13:42
Eduard_MunteanuMatching on [] kinda works, but :: is tough.11/04 13:42
Eduard_MunteanuAlso Agda can't really tell if the functions are partial.11/04 13:43
Eduard_MunteanuFor example it accepts   length : ∀ {a} → List a → ℕ     length [] = 011/04 13:44
* Eduard_Munteanu tries dependent lists11/04 13:45
Eduard_MunteanuNow I think I can safely postulate reduce : ∀ {a} {n : ℕ} → List a (suc n) → (a × List a n)    but I'm not sure that helps.11/04 13:49
* Eduard_Munteanu has to quit playing Oleg in Agdaland and go to school :). o/11/04 14:00
augurif anyone has any advice id appreciate it: http://hpaste.org/45580/linear_orders11/04 16:27
augursince switching to records for digraphs, i get highlights on trich-++11/04 16:28
auguryellow highlights if i dont quantify the n11/04 16:28
augurand red highlights on dgx in Trichotomous (Digraph.edges (dgx ++ dgy)) if i do quantify11/04 16:28
augur(afk)11/04 16:28
augurcopumpkin!11/04 20:15
Eduard_MunteanuHrm, how would you read ⊎ ?11/04 20:31
Eduard_MunteanuLooks like ⊎ is to \Sigma like Either is to Pair.11/04 20:31
augurunion-plus!11/04 20:31
augurwhat11/04 20:32
Eduard_MunteanuHm, I see.11/04 20:32
auguru+ is to sigma like either is to pair11/04 20:32
augurhow does that work now11/04 20:32
Eduard_MunteanuΣ from Data/Product.agda (standard lib)11/04 20:32
Saizan⊎ is Either, no more no less, modulo universe polymorphism11/04 20:33
Eduard_MunteanuSaizan: hm, so can't one generalize like in the case of Σ ?11/04 20:33
Saizansigma is already that generalization11/04 20:33
augursaizan!11/04 20:33
augurwhy doesnt this work: http://hpaste.org/45580/linear_orders11/04 20:34
augur:(11/04 20:34
auguri dont know how to avoid the yellows or reds :(11/04 20:34
Eduard_MunteanuΣ despite its name looks like a generalized product (generalized tuple).11/04 20:34
augurtrich-++ i mean11/04 20:34
SaizanA ⊎ B = Σ Bool (\b -> if b then A else B)11/04 20:34
Eduard_MunteanuOn the other hand ⊎ is more like Either.11/04 20:34
Eduard_MunteanuOh.11/04 20:34
Saizanwhere = there is up to isomorphism :)11/04 20:35
Eduard_MunteanuHrm, so Σ is both products and sums?11/04 20:35
Saizanyep!11/04 20:35
Eduard_MunteanuAh, thanks.11/04 20:35
Eduard_MunteanuΣ is one really neat thingy.11/04 20:35
Saizanaugur: i've no idea because 1) you haven't annotated with the errors 2) i can't load it because i lack the modules imported11/04 20:37
augur:P11/04 20:37
Saizanmaybe you should put a repo up somewhere :)11/04 20:38
augurmaybe!11/04 20:43
augurbut then i'd have to leard how to use repos11/04 20:43
Eduard_Munteanuaugur: I've seen Agda stuff on github, so you could use Git if you're more comfortable with that.11/04 20:48
Eduard_Munteanu(I know I am. :) )11/04 20:48
augurim not at all comfortable with git11/04 21:09
Saizandarcs would probably be easier11/04 21:10
auguri want a gui repo :(11/04 21:10
augurmaybe ill write some repo software for my server11/04 21:10
auguroh but then i'd have to use php11/04 21:10
augurfuck that11/04 21:10
Saizangit has some GUIs11/04 21:11
Eduard_MunteanuNoooooo11/04 21:12
Eduard_Munteanu:)11/04 21:12
Eduard_MunteanuWould it be inconsistent to have stuff like ℕ : Set₁ ?11/04 21:16
Saizanno11/04 21:18
Eduard_MunteanuI mean, ∀n (∀k, k < n, x ∈ Set k -> x ∈ Set n)11/04 21:18
Eduard_MunteanuAh.11/04 21:18
Eduard_MunteanuSo I guess it's just a question of how practical it is.11/04 21:19
Eduard_Munteanu(though arguably the old Set n could be recovered as Set' n \ Set' (n - 1))11/04 21:20
Saizanyeah, the desing space of how to deal with universe levels nicely is something to be explored, Coq has that in fact instead of the agda system11/04 21:21
Eduard_MunteanuOh.11/04 21:21
Eduard_MunteanuAlthough, as far as I heard, Coq is less neat with its Prop - Set separation.11/04 21:21
codolioCumulativity comes with a different set of problems to solve than the ones that Agda currently has.11/04 21:23
Saizanand they want to add some form of universe polymorphism as we have in agda too, because they have problems wrt one type having to be both in a larger and a smaller universe or some other in a single developement, afaiu11/04 21:23
Eduard_MunteanuUniverse polymorphism is awesome.11/04 21:24
Saizan*of some other11/04 21:24
Eduard_MunteanuI'm curious whether it's possible for values not to be urelements.11/04 21:25
Eduard_MunteanuLike, whether computations/proofs are invariant under lifting between sorts.11/04 21:27
Eduard_MunteanuIn math they seem to be, up to isomorphism.11/04 21:28
* Eduard_Munteanu ponders Set -1, -2...11/04 21:29
Eduard_MunteanuHm, are Σ and all that part of Martin-Loef TT? http://wiki.portal.chalmers.se/agda/agda.php?n=Libraries.RulesForTheStandardSetFormers11/04 22:20
codolioYes.11/04 22:21
djahandarieYeah11/04 22:21
djahandarieAssuming you mean the dependent sum there11/04 22:22
Eduard_MunteanuI see, thanks.11/04 22:34
Eduard_MunteanuYeah, I meant the standard Σ from the standard library (Data/Product.agda)11/04 22:34
Eduard_MunteanuDamn, Agda's got Integer but no Int for FFI-ing to Haskell.11/04 22:41
Eduard_Munteanu@hoogle Nat11/04 22:48
lambdabotText.Parsec.Token natural :: GenTokenParser s u m -> ParsecT s u m Integer11/04 22:48
lambdabotText.ParserCombinators.Parsec.Token natural :: GenTokenParser s u m -> ParsecT s u m Integer11/04 22:48
lambdabotText.Parsec.Token naturalOrFloat :: GenTokenParser s u m -> ParsecT s u m (Either Integer Double)11/04 22:48
Eduard_MunteanuDamn, this makes me want to emerge darcs, checkout the Agda repo and fix this mess. :)11/04 22:53
codolioWhat mess?11/04 23:03
Eduard_Munteanucodolio: I'd like to have Int and stuff like that for interfacing with Haskell code11/04 23:07
Eduard_MunteanuSo I'm considering adding a few more types.11/04 23:07
Eduard_MunteanuAlso some ℕ to Nat / Int conversion would be useful.11/04 23:09
dolioWhat Agda would ideally have is efficiently backed finite sets.11/04 23:13
dolioFin (2^32) gets translated to Word32 or something.11/04 23:14
Eduard_MunteanuDamn, there goes my fun time trying to play with dep-typed arrays :/11/04 23:20
Eduard_Munteanu"Now you've got 2 problems." :)11/04 23:20
Saizanjust use Vec and wait for the backend to be smart enough?11/04 23:20
Eduard_MunteanuHm, I suppose you're right, I could use Vec and some _!!_ behind the scenes for now. I don't care that much about performance, just seeing how the API plays out.11/04 23:22
Eduard_Munteanu(or plain haskell lists)11/04 23:22
--- Day changed Tue Apr 12 2011
djahandariedolio, why wouldn't that transformation be able to happen now?12/04 01:35
djahandarieIt feels like it should be easy12/04 01:35
dolioWhich?12/04 01:35
copumpkinit should magically identify natural-shaped things12/04 01:36
djahandariedolio, Fin (2^32) => Word3212/04 01:36
dolioYou might be able to declare a COMPILED_TYPE or whatever for Fin(2^32).12/04 01:36
copumpkinexcept with implicits, Fin isn't really natural-shaped12/04 01:36
copumpkinif you're talking about Fin(2^32), have you seen the bitvector stuff glguy and I worked on a while back?12/04 01:37
copumpkinwe have just about all the proofs we could think of for it12/04 01:37
djahandarieI haven't12/04 01:37
copumpkinhttps://github.com/copumpkin/bitvector12/04 01:37
djahandarieOh, you switched your github username huh12/04 01:37
copumpkincommon arithmetic and bitwise operations, a few algebraic structures on them, and a couple of different orderings on them12/04 01:37
copumpkinand a peano-like "view" of them12/04 01:37
copumpkinmostly stopped developing it cause I couldn't think of anything else to do12/04 01:38
djahandarie-- TODO: the terrifying proofs that toℕ and fromℕ are inverses12/04 01:39
djahandarieGet cracking12/04 01:39
copumpkinoh lol12/04 01:39
copumpkinyeah12/04 01:39
djahandarieWhoa12/04 01:40
copumpkinI'll do that later ;)12/04 01:40
djahandarieThe stuff in Properties.agda is scary12/04 01:40
djahandarieWhy does it need to be so big?12/04 01:40
copumpkinlots of cases12/04 01:41
copumpkinit might not need to be so big12/04 01:41
djahandarieCan't define it inductively or something?12/04 01:41
copumpkinit might not be minimal12/04 01:41
copumpkinbut no, don't think it can be inductive12/04 01:42
copumpkinpeople were talking about big but finite proofs like that on the mailing list a while back12/04 01:42
copumpkinyou need to match on all that stuff to convince agda to evaluate the adder all the way for the answer to be obvious12/04 01:42
copumpkinI'd probably do it differently now12/04 01:43
copumpkinthe big chains of rewrites on things like distributivity of multiplication12/04 01:43
copumpkinwould be nicer if they used the equational reasoning stuff12/04 01:43
copumpkinbut I didn't realize how that worked at the time12/04 01:43
xplatEduard_Munteanu: Set -1 would be finite types, if you had cumulative universes like in Coq.  no Set -2 though ...12/04 01:44
Eduard_Munteanuxplat: I thought a bit more about that, wouldn't Set -1 be Top? As I understand Top should be the set of all values.12/04 01:45
Eduard_Munteanu(but I'm unsure what is meant by finite or why)12/04 01:46
xplatEduard_Munteanu: why would Top be the set of all values?  (i presume you mean ⊤)12/04 01:48
xplat(still, why would it be the set of all values?)12/04 01:49
dolio⊤ is isomorphic to exists t. t12/04 01:49
dolioIf that's what is meant.12/04 01:49
xplatbut ⊤ only has one value12/04 01:50
Eduard_MunteanuUm, from what I recall from TAPL, for any type t, Bot <: ... <: t <: ... <: Top12/04 01:50
copumpkinwhat's the ordering relation?12/04 01:51
copumpkinthat seems like you need subtyping?12/04 01:51
xplatAgda doesn't have subtyping.  and toposes don't have top elements to their type lattice in that sense.12/04 01:51
Eduard_MunteanuSubtyping relation in TAPL, but here we'd use inclusion.12/04 01:51
copumpkinno type includes another type12/04 01:51
Eduard_Munteanucopumpkin: not in the sense of \in12/04 01:52
Eduard_MunteanuIn the sense of sets overlapping.12/04 01:52
xplatEduard_Munteanu: no type includes another type in the sense of \subseteq either12/04 01:52
copumpkinoverlapping how then? if it's just smaller?12/04 01:52
xplat(although it includes the same type in that sense)12/04 01:53
Eduard_MunteanuWait, does \subseteq lead to Russel's paradox or stuff like that too? :/12/04 01:53
xplat(but that's completely trivial)12/04 01:53
copumpkin??12/04 01:53
Eduard_MunteanuYou know, Agda's type-in-type extension makes it inconsistent.12/04 01:53
copumpkinbut we aren't talking about universe hierarchies here are we?12/04 01:54
copumpkinor if we were, I misunderstood12/04 01:54
xplatEduard_Munteanu: if you have 'the set of all sets' you get russel's paradox.  and anyway even if there was a set like that why would it be below Set_0?12/04 01:54
copumpkinI thought you were talking about values of one type being included in some other type in some sense12/04 01:54
Eduard_MunteanuWell, I thought if all "simple" types make a set (namely Set), then perhaps all "simple" values make a Set, namely Top or Set -1.12/04 01:54
dolioYou don't get Russel's paradox even with the type of all types, really. It's not that easy to take advantage of the problem in type theory.12/04 01:55
xplatEduard_Munteanu: they do not.  and you're still mixing up what the universe hierarchy is about12/04 01:55
djahandarieWho is Russel? ;P12/04 01:55
djahandarieYou all seem to know him...12/04 01:55
dolioBertrand Russel.12/04 01:55
dolioTwo ls, apparently.12/04 01:56
Eduard_Munteanuxplat: well, I thought about various injections from a level to another, especially with universe polymorphism. Say   typeOf : \forall {k} -> Set k -> Set (suc k)12/04 01:57
xplatEduard_Munteanu: first of all any type called Set\_n will have sets (that is, types) as elements.  values are not sets here (unlike ZFC).12/04 01:57
Eduard_MunteanuOne would also have a reify, which would be the opposite of that.12/04 01:58
Eduard_MunteanuYeah, I kinda wondered what would be the implications of having Set 0 as the set of all values (as urelements as you mention).12/04 01:59
xplatEduard_Munteanu: what would 'reify Bool' return?12/04 01:59
xplatEduard_Munteanu: and having a type of all values would make typeOf rather ill-defined ...12/04 02:00
Eduard_Munteanuxplat: it could reflect Bool as a value of a hypotethical TypeRep. Say, some sort of a string.12/04 02:00
Eduard_Munteanu(of course, TypeRep : Set)12/04 02:01
dolioYou want an embedding of Set into TypeRep : Set?12/04 02:01
xplatEduard_Munteanu: i'm not sure how reify : \forall {k} -> Set k -> String is the opposite of typeOf either.  (and it can't be an injection either)12/04 02:02
Eduard_MunteanuYeah, it sounds doable. Actually, one could probably extend it for universe polymorphism in a similar manner.12/04 02:02
dolioIt sounds like it'd lead to paradoxes.12/04 02:02
Eduard_Munteanuxplat: it's not an inverse, I meant reversing the arrows.12/04 02:02
xplatEduard_Munteanu: i didn't mean an inverse either12/04 02:03
Eduard_Munteanureify : \forall {k} -> Set (suc k) -> Set k    in the general case but that's not thought through, let's take only k + 1 = 0 and Set -1 = String.12/04 02:04
xplatand Set\_{level-suc n} is too big to be injected in Set\_n, nevermind String12/04 02:04
Eduard_MunteanuWell we can already kinda do it in Haskell given all types we use have a Show instance.12/04 02:06
xplatEduard_Munteanu: you mean a Typeable instance?12/04 02:06
dolioHaskell isn't worried about remaining logically consistent.12/04 02:06
Eduard_MunteanuOr that, but Show kinda reflects the type too.12/04 02:06
pumpkinick12/04 02:06
pumpkinyou can't Show functions12/04 02:06
pumpkinyou can't show infinite things12/04 02:06
pumpkinin any meaningful way12/04 02:06
xplatEduard_Munteanu: show can't reflect anything about an empty type either12/04 02:06
xplatwell, not sanely anyway12/04 02:07
Eduard_MunteanuYeah.12/04 02:07
Eduard_Munteanupumpkin: indeed, Show is a bad example since I'm concerned with types not values.12/04 02:07
Eduard_Munteanu(reflecting types to values, not values to values)12/04 02:08
xplatbut every universe has a cardinality much, much, much, much bigger than strings12/04 02:08
Eduard_MunteanuBut in Haskell I can't think of an infinite type, or in Agda. They both seem to deal with recursion in the isorecursive way.12/04 02:09
xplatEduard_Munteanu: you could say that in Agda you write infinite types the long way.12/04 02:10
xplatnot using recursion12/04 02:10
xplatalthough that's not strictly true12/04 02:10
Eduard_MunteanuI'm having difficulties wrapping my head around the cardinality issue. Yeah I know it could be BIG, but it usually isn't.12/04 02:11
pumpkinagda doesn't like arguments about "it usually isn't"12/04 02:11
xplat(because you can do things like sum with Sigma a family of types that get arbitrarily large)12/04 02:11
Eduard_MunteanuSet is merely composed of normal types + _->_ + whatever else you define it, so whenever you use 'reify' in a finite way, you get finite stuff out of it.12/04 02:12
Eduard_MunteanuOh.12/04 02:12
xplatEduard_Munteanu: defining types doesn't create them12/04 02:12
Eduard_MunteanuErm, postulating them.12/04 02:12
xplatit only picks out an existing anonymous type from Set and names it and its constructors.12/04 02:13
Eduard_MunteanuBut yeah, I guess Sigma is a good example.12/04 02:13
dolioIf you want to create a type with codes for types, that's what induction-recursion does.12/04 02:13
xplat(or from Set\_n)12/04 02:13
dolioBut you won't get an embedding Set -> T.12/04 02:14
xplatso Set does not only consist of the types you actually define in whatever program you wrote12/04 02:14
xplatpostulating can create new stuff, but that's in addition to all the stuff (that you didn't specifically write) that's there already12/04 02:15
Eduard_MunteanuNot even as 'reify' is concerned? I mean, by totality, I shouldn't be able to go "big" on reify.12/04 02:15
Eduard_Munteanuas in every call to reify could yield a (possibly non-unique) String, but finite.12/04 02:16
xplatEduard_Munteanu: totality isn't a magic wand, you have to actually provide a total function12/04 02:17
xplatEduard_Munteanu: so what you will find is you can't actually write reify.12/04 02:17
Eduard_MunteanuHm. That makes sense, I'll never be able to write the definition for reify.12/04 02:17
Eduard_MunteanuWould it be consistent to have it as a language primitive at least?12/04 02:18
Eduard_MunteanuFor every type Agda sees, it prepares a value.12/04 02:18
xplatwell, you can write silly definitions like 'reify _ = "gotcha"'12/04 02:18
Eduard_MunteanuAh.12/04 02:19
pumpkinEduard_Munteanu: then you'd be able to embed (a description of) all sets into a type within one of them?12/04 02:19
xplatbut not ones that meet the full spec12/04 02:19
pumpkinI mean, assuming a primitive12/04 02:19
pumpkinit doesn't sound like a good iea12/04 02:19
pumpkinassuming you want to go both ways12/04 02:19
pumpkinotherwise the description isn't much use12/04 02:20
Eduard_MunteanuIt'd be lossy I suppose.12/04 02:20
Eduard_MunteanuTypes would lose substructure, e.g. if a : T, but I can't say a : reify T12/04 02:20
pumpkinso you want describe : Set -> T, where T : Set, and undescribe : T -> Set, such that they are inverses?12/04 02:21
Eduard_MunteanuNo.12/04 02:21
Eduard_MunteanuFor example, I could have undescribe . describe = String always12/04 02:21
Eduard_Munteanu*const String12/04 02:21
pumpkinso what would be the use of it?12/04 02:22
dolioBreaking parametricity for the hell of it.12/04 02:22
pumpkinoh, fair enough12/04 02:23
Eduard_MunteanuI'm not sure about 'undescribe' but 'describe' has already found use in Haskell.12/04 02:23
pumpkinEduard_Munteanu: you might as well just add some way of eliminating types?12/04 02:23
pumpkin"dependent type families" :P12/04 02:24
Eduard_MunteanuHeh, no, but it's not immediately obvious to me how 'describe' would break consistency.12/04 02:25
pumpkinit would definitely break parametricity12/04 02:25
xplatbut type constructors are known to not be injective or not have disjoint images or something, aren't they?  so wouldn't eliminating type constructors be paradoxical in some way?12/04 02:26
pumpkinwhich we get for set-valued arguments12/04 02:26
xplat*a way of12/04 02:26
pumpkinxplat: I think there's an --injective-type-constructors option, but there's something about it being anti-classical?12/04 02:26
xplat*a way of eliminating12/04 02:26
* pumpkin can't remember12/04 02:26
Eduard_MunteanuI've seen that.12/04 02:26
xplatoh, right, so consistent but anti-classical.  i knew it was something.12/04 02:26
Eduard_Munteanu--injective-type-constructors               enable injective type constructors (makes Agda anti-classical and possibly inconsistent)12/04 02:26
Eduard_MunteanuPossibly.12/04 02:27
xplatoh, anti-classical and POSSIBLY consistent.  joy.12/04 02:27
Eduard_MunteanuWhat is meant by injectivity though?12/04 02:27
Eduard_MunteanuFunctors do seem injective to me.12/04 02:27
pumpkinwell, in haskell they are12/04 02:28
pumpkinbecause you can't make a functor instance for things like type synonyms or families12/04 02:28
xplatbut in haskell the type logic can say any kind of nonsense12/04 02:28
pumpkin(because they can't be partially applied)12/04 02:28
dolioInjective type constructors are inconsistent with impredicativity.12/04 02:28
augurpumpkin! \o/12/04 02:28
Eduard_MunteanuSo given an F : Set -> Set, there is an (a, b) such that a /= b but F a = F b ? :/12/04 02:29
pumpkinyou can make a "real" constant functor12/04 02:29
* pumpkin shrugs12/04 02:30
dolio\A B -> A isn't a type constructor.12/04 02:30
Eduard_MunteanuOh, like you can say F = const Bool ?12/04 02:30
pumpkindolio: I wasn't talking about type constructors12/04 02:31
xplatEduard_Munteanu: it may be that there is such an (a, b) for some Fs (in which case --injective-type-constructors is inconsistent) or maybe you can just not assume that there is no such (a, b)12/04 02:31
dolioType constructors are what are injective in Haskell, and old Agda.12/04 02:32
Eduard_MunteanuYeah, I wonder how --injective-type-constructors actually behaves, or what happens.12/04 02:32
dolioNot arbitrary things with type Set -> Set.12/04 02:32
Eduard_MunteanuIs it about type equality or stuff like that?12/04 02:32
* Eduard_Munteanu didn't get into that stuff yet12/04 02:32
Eduard_MunteanuOh I kinda see why I'm breaking parametricity for the general case, but not Set -> T if T is actually specified12/04 02:35
Eduard_MunteanuI mean Set (suc k) -> Set k, that's rather obvious if implemented as a primitive.12/04 02:36
pumpkinthat just sounds scary12/04 02:36
Eduard_MunteanuBut if T is specified and inhabited... :/12/04 02:36
pumpkinI still don't know what kinds of properties you'd like it to have12/04 02:37
pumpkinyou can implement it trivially with some sort of constant12/04 02:37
pumpkinbut clearly that doesn't cover what you'd want it to do12/04 02:37
pumpkinyou'd want it to be injective, presumably?12/04 02:38
Eduard_MunteanuWell, the interesting puzzle was the general case, I don't actually have much interest for Set -> T though (but it could be useful in practice). I wonder if there's such a Set (suc k) -> Set k which works like Set -> T for k = 012/04 02:38
Eduard_MunteanuI wondered if it was something worthwhile.12/04 02:39
Eduard_MunteanuYeah, injectivity is a good thing.12/04 02:39
pumpkinsee, an injective function from a larger universe to a smaller one just seems to be asking for trouble, in my uneducated opinion12/04 02:39
pumpkin(and for k = 0, that'd still be Set 1 -> Set 0, which isn't to a specific T type)12/04 02:41
dolioIt's definitely asking for trouble.12/04 02:41
pumpkinso we aren't even losing parametricity there12/04 02:41
pumpkinit's just scary-feeling12/04 02:41
pumpkinat least I don't think we're losing parametricity12/04 02:41
Eduard_MunteanuOops I meant (suc k = 0) in a vague sense.12/04 02:41
Eduard_MunteanuWhat was it, f maps A to B injectively  ->   |A| < |B| ?12/04 02:42
Eduard_Munteanu* <=12/04 02:42
Eduard_Munteanu(But if it's not surjective, it still doesn't cover B completely :/)12/04 02:43
pumpkinif it's injective and from a larger universe, I'd hope it'd be surjective :P12/04 02:43
Eduard_MunteanuObviously not all Strings are valid types.12/04 02:44
pumpkinthere are countably many finite strings over a particular alphabet12/04 02:45
pumpkin(finite alphabet)12/04 02:45
pumpkinif I have an injective function from types to strings, that means I only have countably many types12/04 02:45
Eduard_MunteanuTrue, but if it's a primitive, Agda can actually inspect only countably many types anyway. Though I understand concerns about whether this could lead to inconsistency in subtle ways.12/04 02:47
dolioIt almost certainly will, unless you restrict it in strange ways.12/04 02:48
dolioYou can't just look at the fact that all your types will practically be represented by finite length strings.12/04 02:48
dolioAdding it to the language will likely allow you to construct viciously self-referential types.12/04 02:49
Eduard_MunteanuYeah. I guess I should look for better proofs to do.12/04 02:50
pumpkinwe should prove that such a function can't exist12/04 02:50
pumpkin:P12/04 02:50
Eduard_MunteanuI just keep coming up with a type and pursuing whether it could be implemented as a function :)12/04 02:50
Eduard_MunteanuAnyway I think I lost something on the way, why couldn't we have a sort/set of all values?12/04 02:51
Eduard_MunteanuIt seemed like a nice generalization of the Set hierarchy.12/04 02:52
dolioWhat does that mean?12/04 02:52
Eduard_Munteanuforall (A : Set) (x : A) -> x \in MyTop : Set12/04 02:53
dolioWhat's \in mean?12/04 02:53
Eduard_MunteanuBelongs to.12/04 02:54
Eduard_Munteanu12/04 02:54
dolioI'm not asking for a thesaurus entry.12/04 02:54
dolioWhat is its definition?12/04 02:54
Eduard_MunteanuSame as when one says   true : Bool12/04 02:55
Eduard_MunteanuI'm not entirely sure how to formalize it.12/04 02:56
dolioObviously it's not the same, since we're using a different symbol, and : isn't valid where you put it.12/04 02:56
Eduard_MunteanuI can actually do stuff like...12/04 02:58
Eduard_Munteanupostulate    ⁉ : ℕ12/04 02:58
Eduard_MunteanuI know, I probably can't make MyTop in Agda.12/04 03:00
Eduard_MunteanuBut would it be a leap to inconsistency if Agda already had it as a builtin??12/04 03:00
Eduard_MunteanuIt seems natural to have a set of all values. Or do such (some) sets have to be disjoint?12/04 03:01
pumpkinit only seems natural in a subtyping world12/04 03:01
pumpkinto me,at least12/04 03:02
dolioYou can have something like exists t. t.12/04 03:04
dolioAlthough in Agda, that'd be a Set1.12/04 03:04
xplata mapping from Set\_n+1 to Set\_n should be inconsistent for the same reasons as --type-in-type12/04 03:05
xplat*an injective mapping12/04 03:05
xplatit should be possible to construct the same paradoxes with a little bit of translation12/04 03:06
Eduard_MunteanuI see.12/04 03:06
Eduard_MunteanuAnyway, thanks guys, I've been pestering you quite a bit :)12/04 03:06
Eduard_MunteanuI should probably just pick some real theorems to work on. :)12/04 03:07
* augur bites pumpkin12/04 03:32
Eduard_MunteanuAww, you broke him.12/04 03:42
auguraha!12/04 04:54
augurhttps://github.com/psygnisfive/algebraic-syntax12/04 04:54
copumpkinoof12/04 07:06
seafoodHi Agda peeps! I'm a long term lurker. I've got a question about comparison of naturals. When I import Data.Nat we get the ≤ data type. However, I've noticed that there is no function that takes two naturals and returns a Bool. I'm assuming that comparing something to get a Bool is not the "approved" way of comparing two natural numbers. What *is* the approved way though?12/04 07:11
seafoodAnd if that question makes no sense please ask for clarification.12/04 07:14
TacticalGraceThe problem with "conventional" comparison is that it gives you no type level indication of the result12/04 07:16
lambdabotTacticalGrace: You have 1 new message. '/msg lambdabot @messages' to read it.12/04 07:16
TacticalGraceor in othe rwords, you don't get a proof for whether one number is smaller than the other12/04 07:16
seafoodTacticalGrace: Okay, I think I get that. How would I write a function which compares two numbers and does something depending on whether there is a proof or not.12/04 07:19
TacticalGraceI'll talk about this in the lecture tomorrow ;)12/04 07:20
TacticalGracebut essentially, you return a disjunction of either x <= y or y < x12/04 07:21
TacticalGracewhere with <=, I mean the ≤ data type.12/04 07:21
TacticalGraceie, you get a proof for one or the other as you are dealing with a total order12/04 07:21
seafoodAnd then pattern match to distinguish?12/04 07:22
TacticalGraceyou use the result of the comparison with Agda's 'with' construct12/04 07:22
TacticalGrace(which we also discuss tomorrow)12/04 07:22
TacticalGraceyeah, pattern match with 'with'12/04 07:22
seafoodSlides already on your course page?12/04 07:22
TacticalGraceyep12/04 07:22
seafoodI'll read them now.12/04 07:22
TacticalGracehave a look at the function 'tot'12/04 07:22
copumpkinthere's a <=? in Data.Nat in the standard library12/04 07:23
copumpkinwhich returns a Dec _<_12/04 07:23
copumpkinDec is a "fancy bool" that carries a proof with it along with two constructors yes and no12/04 07:24
seafoodcopumpkin: Yeah, I just found that. It returns a "yes" or "no"12/04 07:24
copumpkinyou could easily translate it to Bool by forgetting the proofs on the yes and no12/04 07:24
copumpkinbut you shouldn't12/04 07:24
seafoodcopumpkin: Yeah, I just managed to pattern match on that using Agda's with construct.12/04 07:24
seafoodI don't necessarily *want* to produce a Bool. I just want to be able to do find out when something is less than or equal to something or not. Bools kind of suck, right? No provenance.12/04 07:25
copumpkinexactly, yeah12/04 07:25
copumpkinusually if you bother finding out whether two things are related somehow, you found out more stuff along the way12/04 07:25
copumpkinthat you then throw away and compress into a measly Bool12/04 07:25
seafoodWhat a waste :-)12/04 07:26
copumpkindamn right12/04 07:26
copumpkinsay you wanted to check at runtime if a user-input number was less than 10, because you had a vector of length 10 to index into with his input12/04 07:26
copumpkinto index into a vector, you need to use a Fin12/04 07:26
copumpkinbut you only have a natural12/04 07:27
copumpkinso you use <=? and if you get a yes, you can use the proof of <= to convert your natural into a Fin12/04 07:27
copumpkinif you get a no, you can smack the user and tell them to try again12/04 07:27
seafoodcopumpkin: Nice. Another question is there ≥? too?12/04 07:28
copumpkinjust flip the arguments :P12/04 07:28
copumpkinbut no12/04 07:28
copumpkinwell, there might be a convenience method12/04 07:28
copumpkinbut there's only one type12/04 07:28
copumpkinthere is a trichotomous _<_12/04 07:28
seafoodWhat does trichotomus mean?12/04 07:29
copumpkinit says that a natural is either less than another, equal to it, or greater12/04 07:29
lispyI just want to point out, that even though Agda is easier to install on windows than Isabelle, it's easier to get coq than agda :(12/04 07:29
TacticalGracelispy: installation could indeed be easier12/04 07:29
TacticalGracelispy: quite a few of my students struggeled12/04 07:30
lispyTacticalGrace: Yeah, for me it's "do I want to bother?"  I regularly use both osx and linux.  Having it on this windows box is unnecessary, but would be nice.12/04 07:30
seafoodcopumpkin: I guess my ultimate question is, "What does the working Agda programmer user when they want to compare two naturals and do something based on their relationship?"12/04 07:31
copumpkin<=? or compare, probably12/04 07:31
seafoodcopumpkin: I find it strange that there is_≤?_ but no <?12/04 07:31
copumpkinwell, you can get <? from _=?_ and <=?12/04 07:32
copumpkinor just from compare12/04 07:32
copumpkinhttp://www.cse.chalmers.se/~nad/listings/lib/Data.Nat.html#364012/04 07:32
zimanhello, a personal preference question: what do you (dis)like about agda, compared to, say, coq?12/04 07:37
augurcopumpkin!12/04 07:43
auguri have a repo now12/04 07:43
augurhttps://github.com/psygnisfive/algebraic-syntax12/04 07:43
copumpkinI'm following it :)12/04 07:43
copumpkinbut going to sleep12/04 07:43
augur:(12/04 07:43
augurcopumpkin: its your fault!12/04 07:44
copumpkinziman: syntax is nicer, more haskell-like, universe polymorphism is cool, explicitness about proof is cool in principle, but often tedious, but I still prefer it to implicit proof state changing. I also like the agda approach to tactics in theory, although nothing significant has actually been developed using them! I'd also like better memory usage in agda, since some of my proofs I Can't even typecheck cause they're so big12/04 07:45
copumpkinaugur: what is?12/04 07:46
augurthe fact that now part of it doesnt work :P12/04 07:46
copumpkinoh12/04 07:46
copumpkinwell, fix it!12/04 07:46
augurim trying but i dont know whats wrong12/04 07:47
copumpkinwhat does it say is wrong?12/04 07:48
augurwell, depends on the version. with quantification of levels, it just gives me a type check error12/04 07:48
augurwithout that it gives me a type inference complaint for the whole of trich-++12/04 07:49
augurand its all because of this .. record thing of yours!12/04 07:52
copumpkinlol12/04 07:53
copumpkinI'm sure it's something silly12/04 07:53
augurprobably12/04 07:53
seafoodcopumpkin: What am I doing wrong? http://hpaste.org/45607/using_compare12/04 07:57
copumpkinyou need to use dot patterns to constrain your patterns more12/04 07:58
copumpkinmin .m .m | equal m = m12/04 07:58
seafoodI don't really know what dot patterns are. Sorry.12/04 07:59
lispyit's like a named and inferred variable, IIRC12/04 07:59
lispybasically, the min of m and m implies m = m?12/04 07:59
copumpkinit's not about the min, it's about pattern matching on that equal12/04 07:59
lispyer rather than min m m = m12/04 07:59
copumpkinit refines its indices to be equal12/04 08:00
copumpkinand if you don't indicate that in the rest of your pattern, it's "too free"12/04 08:00
copumpkinpattern matching in agda can get really hairy12/04 08:00
copumpkinbecause sometimes you'll end up with fairly complex arbitrary expressions in your patterns12/04 08:00
copumpkinyou'll probably get similar errors using the less and greater constructors12/04 08:01
copumpkinI'd just ask agda to pattern match on the result of compare for you12/04 08:01
copumpkinit'll take care of doing the dirty work and you can see how it should be done12/04 08:01
seafoodThere's a short cut to do that in Emacs?12/04 08:01
copumpkinC-c C-c12/04 08:02
copumpkinon a pattern variable, if there's just a hole in the right-hand side12/04 08:02
copumpkinit'll automatically expand the pattern12/04 08:02
auguroh sure, answer his question, copumpkin :(12/04 08:02
copumpkinlol12/04 08:03
copumpkinI was going to go to sleep12/04 08:03
copumpkinanyway, now I will12/04 08:03
augur:|12/04 08:03
copumpkinfine fine12/04 08:04
augurTHE MARRIAGE IS OFF12/04 08:04
augurFOR NOW12/04 08:04
augur>|12/04 08:04
seafoodcopumpkin: Thanks for your help.12/04 08:04
augurnight dude12/04 08:04
seafoodaugur: Sorry I broke up your marriage dude :)12/04 08:04
augur;p12/04 08:04
seafoodaugur: I hate being "the other guy"12/04 08:04
copumpkinaugur: _++_ : ∀ {ℓ} → Digraph {ℓ} → Digraph {ℓ} → Digraph {ℓ}12/04 08:06
copumpkinthat should be your signature there12/04 08:06
copumpkintrans-++ : ∀ {ℓ} → (dgx : Digraph {ℓ}) → Transitive (Digraph.edges dgx) → (dgy : Digraph) → Transitive (Digraph.edges dgy) → Transitive (Digraph.edges (dgx ++ dgy))12/04 08:06
copumpkinthat should be your signature there12/04 08:06
copumpkinand then it typechecks again12/04 08:06
copumpkinI'd just make the level parameter on Digraph explicit12/04 08:07
copumpkinit's never going to really be able to infer it anyway12/04 08:07
augurwell fine! be that way12/04 08:07
augur:|12/04 08:07
copumpkinanyway, now that that's fixed, you can refine linear-++ :D12/04 08:07
copumpkinand it'll give you a pair12/04 08:07
augur<312/04 08:07
augur:(12/04 08:07
augurwhy are you so good at this :(12/04 08:08
copumpkinwhat's wrong?12/04 08:08
copumpkinI really am not :P but I know what the obscure errors mean12/04 08:08
copumpkinif it says it depends on something it can't depend on12/04 08:08
copumpkinit probably means that you have a secret metavariable that you haven't made explicit somewhere12/04 08:08
copumpkinlike your Digraph in ++12/04 08:08
copumpkinit took a {ell} parameter12/04 08:08
copumpkinbut you didn't say where the ++'s version was supposed to get that {ell} parameter from12/04 08:09
augurtrue true12/04 08:09
auguri hadnt modified ++ after making digraph a record12/04 08:09
copumpkinit won't magically infer that just because your parameters have implicit parameters, the function should too (I think epigram 1 would)12/04 08:09
copumpkinanyway, now time for bed :P you're east coast too, go to sleep!12/04 08:10
auguruh12/04 08:11
augurits 3am12/04 08:11
augurwhy would i go to sleep12/04 08:11
auguri have code to write12/04 08:11
copumpkin:P12/04 08:11
copumpkinok12/04 08:11
auguryou forget12/04 08:12
augurim an academic12/04 08:12
augurnot a corporate type like you!12/04 08:12
copumpkin:D12/04 08:12
seafoodcopumpkin: It turned into http://hpaste.org/45608/using_compare_annotation12/04 08:12
seafoodcopumpkin: Where do you work?12/04 08:12
copumpkina financial software company in boston12/04 08:12
copumpkinseafood: that's what it should be, yeah12/04 08:12
seafoodC-c C-c was useful!12/04 08:13
augurfinancial software12/04 08:13
augurpah12/04 08:13
augurwhats the point of financial software12/04 08:13
augurto help make the rich richer!12/04 08:13
copumpkinlol12/04 08:13
augurmind yourself, copumpkin. you're a collaborator12/04 08:13
copumpkinseafood: yeah, very useful!12/04 08:13
copumpkinseafood: C-c C-r is also very useful12/04 08:13
seafoodcopumpkin: I keep thinking it would be fun to work in the financial software world but I think the world is over-financialised as it is.12/04 08:14
copumpkinseafood: if you use it in an empty hole that can only be "eliminated" in one way (maybe only one data constructor fits, or it's a function, or a record) it'll fill that in for you and give you addiitonal holes12/04 08:14
copumpkinI'm somewhat insulated from the actual finance and the shady practices, actually. My company doesn't do any of it, and doesn't even provide software to those who do. It provides software to those who may collaborate with those who do though :P12/04 08:15
seafoodI know the money is great, but after reading The Black Swan (by Nassim Taleb) I can't help think that no one really knows what is going on in that world.12/04 08:15
seafoodYou read it?12/04 08:15
copumpkinthere are several financial worlds12/04 08:15
copumpkinnope12/04 08:15
seafoodAnd... I'm keeping you from your sleep.12/04 08:15
seafoodYou should go to sleep.12/04 08:15
copumpkin:)12/04 08:15
copumpkinlet's talk some other time12/04 08:15
seafoodSure.12/04 08:15
copumpkinzZzZzZZZ12/04 08:15
copumpkin(good luck *snore)12/04 08:15
zimancopumpkin, thanks :)12/04 08:47
Eduard_MunteanuIs there 'do' notation in Agda?12/04 19:13
Saizanshould be implementable with a syntax declaration12/04 19:14
Eduard_MunteanuThanks. I'm looking through the release notes to find stuff on that.12/04 19:17
starcloudedhello everybody12/04 19:36
starcloudedI am implementing something in agda that needs an import of Data.List and Data.Vec how can I manage the name conlict for example for _++_?12/04 19:38
Saizanyou could e.g. open import Data.Vec hiding (_++_)12/04 19:41
starcloudedthe thing is that I am using _++_ with list and vectors12/04 19:43
Saizanthere's also renaming, or importing without opening12/04 19:46
Saizanhttp://wiki.portal.chalmers.se/agda/pmwiki.php?n=ReferenceManual.Modules12/04 19:47
Eduard_MunteanuWhat's a replacement for Haskell newtypes? Open coded functors?12/04 20:00
copumpkinI was wondering if abstract definitions would be sufficient12/04 20:14
copumpkinabstract12/04 20:15
copumpkinX : Set12/04 20:15
copumpkinX = List Nat12/04 20:15
Eduard_MunteanuHm, where can I read about 'abstract'?12/04 20:17
Eduard_MunteanuShould I grep release notes?12/04 20:17
Eduard_MunteanuBTW, I figured out a way to pass Ints around, and some more examples of using the FFI. http://www.cs.swan.ac.uk/~csetzer/software/agda2/IOLib/IOLibVers.0.1/InteractivePrograms.IOGraphicsLib.html12/04 20:18
Eduard_MunteanuSeems like COMPILED pragmas can be actual Haskell expressions.12/04 20:18
Eduard_MunteanuI'm doing stuff like... STVec : ∀ {k} → Set → Set k → ℕ → Set k       STVec s a n = Prim.STArray s a12/04 20:19
* Eduard_Munteanu hopes this plays out well12/04 20:22
Eduard_MunteanuMmm, Fin is really neat for this!12/04 20:46
djahandarieYou get Fin and Vec in Haskell too12/04 20:51
Eduard_Munteanu@pl \f x y -> f x (g y)12/04 20:51
lambdabotflip flip g . ((.) .)12/04 20:51
Eduard_MunteanuMm, didn't know about Fin in Haskell.12/04 20:52
Eduard_MunteanuBut I guess it makes more sense with True (tm) dependent types in Agda.12/04 20:52
Eduard_MunteanureadSTVec : ∀ {k} {s} {a : Set k} {n : ℕ} → STVec s a n → Fin n → ST s a    -- sweet12/04 20:53
djahandariePresumably you could infer n too12/04 20:53
Eduard_MunteanuHm I could try.12/04 20:54
Eduard_MunteanuDidn't compile yet.12/04 20:54
djahandarieI don't really like infering anything except really mundane things like Levels12/04 20:58
Eduard_MunteanuYeah, I tend to be verbose usually.12/04 20:59
Eduard_MunteanuIt's not like it's a huge type anyway.12/04 20:59
Eduard_MunteanuIf I have a function f : ∀ {n : ℕ} -> ...   can I reify the natural there into a value when writing f's definition (f = ...)?12/04 21:17
Eduard_MunteanuI want to write stuff like    f n [...] = g n [...]12/04 21:18
Eduard_MunteanuOr a different way to look at it, given n : ℕ, let X : ℕ -> Set such that X n = { n } (as a set). What's X?12/04 21:24
kosmikusEduard_Munteanu: I think I don't understand your question(s).12/04 21:38
kosmikuswhat do you mean "reify the natural into a value"? the natural number already is an argument you can use, what do you want to reify it to?12/04 21:41
djahandarieThe way he worded the last question it sounded like he was talking about reflection12/04 21:41
Eduard_Munteanukosmikus: let f : ∀ (n : ℕ) -> Something, and g : ℕ -> Something (an already defined function).12/04 21:41
djahandarieThose two are equiv12/04 21:42
Eduard_MunteanuI want to write something along the lines of   f n = g n.12/04 21:42
djahandarieAnd the forall is useless12/04 21:42
djahandarief : (n : Nat) -> Foo; g : Nat -> Foo; -- the same12/04 21:42
kosmikusyes12/04 21:42
kosmikusboth are the same12/04 21:42
djahandarieThe first one just puts the value of the first parameter into scope on the type level in case you want to use it12/04 21:43
djahandarieBut in your case you don't so the functions are the same12/04 21:43
Eduard_MunteanuUm? How could the be the same?12/04 21:43
kosmikusjust as djahandarie explained12/04 21:43
Eduard_MunteanuBut 'n' is a number, it has no inhabitants, while ℕ does have.12/04 21:43
djahandarien is a term of type N, which you are allowed to use in the type signature12/04 21:44
djahandarieThe type of the first parameter is still N12/04 21:44
djahandarie(For when you write the definition)12/04 21:44
djahandarief : (n : Nat) -> Foo n; f x = makeMeSomeFoo x -- for example, here x : Nat12/04 21:45
Eduard_MunteanuWait a sec, when I write   f : ∀ (A : Set) -> ...,   the first parameter is certainly some x : A, not some x : Set.12/04 21:45
kosmikusno12/04 21:46
djahandarieNo, it is x : Set12/04 21:46
kosmikusthere's no argument of type A unless you ask for one12/04 21:46
kosmikusf : (A : Set) -> A -> ...12/04 21:46
kosmikusthis gets an argument of type set, called A, and then an argument of type A12/04 21:46
Eduard_MunteanuThis is confusing :/12/04 21:47
djahandarieEduard_Munteanu, remove all the    x :    from your signature and that is the actual type of the parameters12/04 21:47
djahandarie(Not really since that x may be used later, but this will somewhat help)12/04 21:48
djahandarieAll the binding in the type signature is for is for when you want to do dependent types12/04 21:48
djahandarie(I.e., make something later in the type depend on the value of something earlier in the type)12/04 21:49
Eduard_MunteanuHm, I thought the binding gave the type.12/04 21:49
Eduard_MunteanuLike with plain type ascriptions.12/04 21:50
* Eduard_Munteanu is really confused now :)12/04 21:50
djahandarie_++_ : (a : Set) -> (n : Nat) -> (m : Nat) -> Vec n A -> Vec m A -> Vec (n+m) A12/04 21:50
copumpkinn as a set?12/04 21:50
copumpkin:O12/04 21:50
djahandarieOops, capital A at the beginning12/04 21:51
copumpkinpresumably you want those to be implicit?12/04 21:51
kosmikuscompare "oneTo : Nat -> List Nat" and "oneTo' : (n : Nat) -> Vec n Nat"12/04 21:51
djahandariecopumpkin, no, not for the moment12/04 21:51
copumpkinwhy use the underscores then?12/04 21:51
djahandarieOh, good point there :p12/04 21:51
djahandarieappend : (A : Set) -> (n : Nat) -> (m : Nat) -> Vec n A -> Vec m A -> Vec (n+m) A12/04 21:51
djahandarieappend Top 3 4 [top, top, top] [top, top, top, top] -- is how you would call this12/04 21:52
djahandarieWhere top : Top12/04 21:52
Eduard_MunteanuOh.12/04 21:53
djahandarieSo the bindings in the type signature just let you use Top, 3, and 4 in the type signature rather than only on the value level12/04 21:54
djahandarieSo partially applying append....   append Top 3 4 : Vec 3 Top -> Vec 4 Top -> Vec 7 Top12/04 21:54
Eduard_MunteanuI thought I'd end up needing 'top' there in the first arg.12/04 21:55
Eduard_MunteanuOk, so it's the right hand side of the ':' that matters wrt values.12/04 21:56
djahandarieYeah12/04 21:56
Eduard_MunteanuAh, thanks, I think I can see it now.12/04 21:56
Eduard_MunteanuI just need to match on my implicit arg then.12/04 21:56
djahandarieYep12/04 21:56
djahandarieWhich you can do by wrapping the arg in {} on the value level12/04 21:56
Eduard_MunteanuYeah.12/04 21:57
Eduard_MunteanuIf I need to specify one implicit arg, I have to specify them all, right?12/04 22:03
Eduard_Munteanus/specify/match on/12/04 22:03
kosmikusEduard_Munteanu: no, you can refer to them by name12/04 22:07
Eduard_Munteanukosmikus: same name as in the type, right?12/04 22:08
kosmikusf : {a : Nat} {b : Nat} -> ...; f {b = 2} = ...12/04 22:08
Eduard_MunteanuOh.12/04 22:08
Eduard_MunteanuThanks.12/04 22:08
Eduard_MunteanuAnd if I don't want to match on an explicit value, then    f { b = _ } =  ... ?12/04 22:09
Eduard_MunteanuI just want to bring it in scope.12/04 22:09
kosmikus{b = b}12/04 22:09
kosmikuslooks strange, but works12/04 22:09
Eduard_MunteanuI see, thanks.12/04 22:09
kosmikusor {b = x}12/04 22:09
kosmikusone b refers to the name used in the type12/04 22:09
kosmikusthe right hand side is a normal pattern12/04 22:10
kosmikusso you can use a variable there12/04 22:10
Eduard_MunteanuI also wonder if I can write   f : {(suc n) : Nat}12/04 22:12
Eduard_Munteanu(to get it in Nat^* that is)12/04 22:15
kosmikusEduard_Munteanu: no12/04 22:19
Eduard_MunteanuHm, I wonder how to refine Nat then without coming up with lotsa different types.12/04 22:21
Eduard_MunteanuMmm, maybe an implicit argument that somehow requires 'pred n' to exist.12/04 22:23
kosmikusthere's generally a choice between defining a new type or taking a separate proof term12/04 22:24
* Eduard_Munteanu thinks in terms of currying12/04 22:24
kosmikusso in this case, you could do something like (n : Nat) -> (n > 0) -> ...12/04 22:24
Eduard_MunteanuOh, interesting, thanks.12/04 22:25
Eduard_MunteanuI'd like it to be implicit though.12/04 22:25
Eduard_Munteanu(I suppose that's not an issue)12/04 22:25
kosmikuswell, it depends on how you define _>_12/04 22:26
kosmikusbut I have to leave now12/04 22:26
kosmikusgood luck ;)12/04 22:26
Eduard_MunteanuThanks for your help.12/04 22:26
Eduard_MunteanuMm, it's already defined for ℕ.12/04 22:27
Eduard_MunteanuI guess I'll try it.12/04 22:27
Eduard_MunteanuBut I guess checking n /= 0 simply amounts to packing 'pred n' into some type.12/04 22:28
auguris there a list of agda mode available chars?12/04 23:42
augursymbols, whatever12/04 23:42
--- Day changed Wed Apr 13 2011
Eduard_Munteanu@tell augur You might want to look in the Agda sources at src/data/emacs-mode/agda-input.el for symbols13/04 00:03
lambdabotConsider it noted.13/04 00:03
lispy_confusing type error is confusing13/04 02:27
lispy_(c ℓ : .Level.Level) → Set (.Level.Level.suc (.Level._⊔_ c ℓ)) !=<13/04 02:27
lispy__0 of type Setω13/04 02:27
lispy_when checking that the expression CommutativeMonoid has type _013/04 02:27
lispy_module Semantics (CM : CommutativeMonoid) where13/04 02:28
lispy_That module line is the one giving that error13/04 02:28
doliolispy_: Presumably CommutativeMonoid isn't valid on its own.13/04 02:37
dolioThe module should probably take a level parameter, and use with with CommutativeMonoid.13/04 02:37
lispy_dolio: hmm13/04 02:42
lispy_dolio: how do level parameters work for modules?13/04 02:42
dolioSame as everything else.13/04 02:44
lispy_CommutativeMonoid is defined this way: record CommutativeMonoid c ℓ : Set (suc (c ⊔ ℓ)) where13/04 02:44
lispy_So I need to provide c and l?13/04 02:44
dolioYes.13/04 02:45
lispy_I don't know the normal way to provide level parameters in Agda.  I haven't encountered that yet13/04 02:45
lispy_(This broken code is part of a _tutorial_)13/04 02:45
doliomodule Semantics {c l} (CM : CommutativeMonoid c l) where13/04 02:45
dolioOr {c l : Level} if you prefer.13/04 02:45
lispy_okay, thanks.  I'll try that13/04 02:45
lispy_dolio: thanks.  That fixed that issue13/04 02:47
dolioGood.13/04 02:47
doliohttp://code.haskell.org/~dolio/agda-share/html/Simplex.html13/04 04:47
dolioThat file uses a surprising amount of memory.13/04 04:47
dolioI think it's the 6 nested sigmas.13/04 04:47
copumpkinyeah, Saizan mentioned finding that nested sigmas really blew up memory usage13/04 04:50
dolioQuite surprising.13/04 04:50
augurhey copumpkin13/04 04:52
lambdabotaugur: You have 1 new message. '/msg lambdabot @messages' to read it.13/04 04:52
augurhey dolio13/04 04:52
augur!13/04 04:52
copumpkinDUUDE13/04 04:52
augursup guy13/04 04:53
auguror not, copumpkin :|13/04 05:22
copumpkinyo13/04 05:22
copumpkinaugur: sup?13/04 05:37
augurcopumpkin: figuring out how to encode the idea of inclusiveness :)13/04 05:39
copumpkininclusiveness?13/04 05:40
augura good question!13/04 05:42
augurthats part of the question13/04 05:43
augurreally its something like informational monotonicity of a sort13/04 05:43
augurwhere if you have some relation over structures, and some operation that combine structures13/04 05:43
augurthe stuff that was true before combining structures is true after13/04 05:44
augurits hard to state tho13/04 05:57
auguri mean, i have a rough idea how to state it, but not a clear sense of how to write it in agda13/04 05:57
augurcopumpkin: how can i ensure that some type is a record type?13/04 06:21
copumpkin?13/04 06:21
auguror well..13/04 06:21
augurhm13/04 06:21
augurhttp://hpaste.org/45647/convoluted_proposition13/04 06:22
copumpkindude line breaks13/04 06:22
copumpkinhttp://hpaste.org/paste/45647/convoluted_proposition_annota#p4564813/04 06:23
auguri just did that XD13/04 06:23
auguryou see what im aiming for tho?13/04 06:24
copumpkinwhat's a T?13/04 06:24
augura structure13/04 06:25
auguri mean, thats the goal13/04 06:25
augurideally you'd be able to abstract over p and q too13/04 06:25
augursince they should be the same13/04 06:25
augurso like, you give it something like, say13/04 06:25
augur..13/04 06:25
augurwell, this should hold, ideally:13/04 06:26
augur_++_ InclusiveL _<_ [ some-iso ] _<_13/04 06:26
auguractually, ultimately, i'd like to make it just single-opped, right13/04 06:26
augurso you could say like13/04 06:26
augurInclusiveL _++_ some-iso _<_13/04 06:27
auguror whatever13/04 06:27
copumpkinhow are you taking fst of xy?13/04 06:27
copumpkinwhen it's a _+_?13/04 06:27
auguror maybe that should be LinearOrder._<_13/04 06:27
auguroh whoops13/04 06:27
augurbut thats not the issue13/04 06:27
augurthe issue is that i dont know how to state this at all13/04 06:28
auguri mean, meh13/04 06:28
auguri dont know13/04 06:28
copumpkinI can sort of see what you want to do13/04 06:29
copumpkinbut am not quite sure13/04 06:29
copumpkinthere are several properties like it in the standard library though13/04 06:29
augurthe idea is that if, say, (X,<) and (Y,<') are linear orders, and ++ : LinearOrder -> LinearOrder -> LinearOrder13/04 06:29
augurand iso : X + Y -> carrier (X ++ Y)13/04 06:29
copumpkinsomething like http://www.cse.chalmers.se/~nad/listings/lib/Relation.Binary.Core.html#323013/04 06:30
augur(so it injects the elements of both orders into the combined order)13/04 06:30
augurthen when < holds of two X's, <'' holds of two X++Y's13/04 06:30
augurie, concatenation doesnt change order13/04 06:30
copumpkinyeah13/04 06:31
copumpkindunno13/04 06:31
copumpkinsounds tricky to state but look around the standard library13/04 06:32
augurhm.13/04 06:32
copumpkinchances are NAD has already done something like it somewhere :P13/04 06:32
copumpkinI'm sleepy though13/04 06:32
auguri mean, it depends on being able to give the predicate the operation of the structure, abstractly13/04 06:32
auguror the operation's accessor, anyway13/04 06:33
augurthats how it should go13/04 06:33
augurit should be something like get-op : T -> Rel T.carrier _13/04 06:34
augurer..13/04 06:34
augurget-op (X : T) -> Rel (T.carrier X) _13/04 06:34
augurbecause iinm something like Digraph._<_ is (dg : Digraph) -> Rel (Digraph.carrier dg) _13/04 06:35
augursince Digraph._<_ dg : Rel (Digraph.carrier dg) _13/04 06:35
augurhm yes yes13/04 06:35
augurlets see13/04 06:35
augurbut how to say that T is a record type?13/04 06:35
copumpkinyou don't13/04 06:36
copumpkinwhy do you care?13/04 06:36
augurwell, because i need to be able to say T.carrier!13/04 06:37
auguror is that just behind-the-scenes magic that i can ignore?13/04 06:37
copumpkinyou'd just make T a concrete record, I guess13/04 06:38
copumpkinyou're trying to quantify over all "structures"?13/04 06:38
copumpkinthat's awfully vague :P13/04 06:38
copumpkinI started doing something like that in a universal algebra-ey sense and by emulating extensible records a while back13/04 06:38
augurwell, over structures with a carrier field i suppose13/04 06:38
copumpkinwell, you'll need to formalize what you mean for something to be a structure13/04 06:39
copumpkinpresumably you want it to have more than a carrier13/04 06:39
auguri suppose i could also use a carrier accessor13/04 06:39
augur\o/13/04 06:51
auguri think i can now do something like13/04 06:51
augur_++_ Over LinearOrder.carrier Respects[ ... ] LinearOrder._<_13/04 06:51
augurwhere ... is the isomorphism underlying _++_13/04 06:52
augurer, the injection, rather13/04 06:53
copumpkincool :)13/04 06:53
copumpkinanyway, I gotta sleep13/04 06:53
augurwe'll see!13/04 06:53
auguroh but i think i should be defining things differently, yes13/04 06:59
augurcopumpkin: http://hpaste.org/paste/45647/convoluted_proposition_annota#p4565013/04 07:05
auguri suppose i could also clear that up and make it a conjunction13/04 07:05
augurlike that new annotation13/04 07:07
augurwhoops, i forget a bit there13/04 07:07
* augur flops on copumpkin :D13/04 07:13
Eduard_MunteanuCan I FFI something in Set n to Haskell?13/04 11:53
Eduard_MunteanuMy guess would be no, but I'm unsure. I'm basically looking to put some x : Set n into a Haskell array.13/04 11:55
Saizanhttp://homotopytypetheory.org/2011/04/10/just-kidding-understanding-identity-elimination-in-homotopy-type-theory/ <- anyone has a proof of the second version of J using the first instead of pattern matching?13/04 12:01
Eduard_MunteanuYay, my ST dependent array compiles, time to put it to a test.13/04 12:03
Eduard_Munteanu(but no universe polymorphism)13/04 12:03
Eduard_MunteanuI also found a smart way to make sure something's in N+, I simply refer to it as suc . pred $ n. Neat! Thanks Agda! :)13/04 12:05
Eduard_Munteanu:t runSTArray13/04 12:18
lambdabotNot in scope: `runSTArray'13/04 12:18
Eduard_MunteanuHow do I interface to Haskell functions whose types are rank-2/N?13/04 13:17
Eduard_MunteanuIt looks like the generated .hs doesn't use a LANGUAGE pragma for that.13/04 13:17
Eduard_Munteanu(just existential quantification but I still need Rank2Types)13/04 13:18
Eduard_MunteanuIt gives me parse errors :(13/04 13:18
* Eduard_Munteanu tries to relax the type signature for the COMPILED pragma.13/04 13:20
Eduard_MunteanuBah, can't I do unqualified IMPORTs?13/04 13:34
Eduard_MunteanuMaybe I should skip type sigs completely :/13/04 13:46
Eduard_MunteanuYay, got my dependent ST array working.13/04 14:28
Eduard_MunteanuIs f : Set -> Set like a newtype or more like a type synonym? I'm having some problems.13/04 14:51
Eduard_MunteanuFor example Set -> ℕ -> Set seems to forget about the natural.13/04 14:52
Eduard_Munteanu(when doing unification)13/04 14:52
copumpkinit's a type synonym13/04 14:54
copumpkinit would only forget about the natural if it doesn't show up in your type13/04 14:55
copumpkinagda is strongly normalizing13/04 14:55
copumpkinit'll always evaluate things as far as it can13/04 14:55
copumpkinincluding type synonyms13/04 14:55
Eduard_MunteanuWell that's my issue because if I use something like that to define my STVec, it seems to forget about the natural. And some wrong programs pass the typechecker because it doesn't check all constraints.13/04 14:56
Eduard_MunteanuShould I use a 'data' and not expose the natural as a value then?13/04 14:56
copumpkinI'm going to guess you're probably doing it wrong somehow :P13/04 14:57
copumpkinyou shouldn't have to, unless I've misunderstood your question13/04 14:57
Eduard_MunteanureadSTVec : ∀ {s} {a : Set} {n : ℕ} → STVec s a n → Fin n → ST s a     where  STVec : Set → Set → ℕ → Set13/04 14:57
copumpkinwhat is the definition of STVec?13/04 14:57
Eduard_MunteanuIt seems to be Fin n doesn't unify with STVec s a n correctly, because if I go out of bounds it passes the typechecker.13/04 14:57
Eduard_MunteanuSTVec s a n = Prim.STArray s Prim.Int a13/04 14:58
Eduard_MunteanuIt's "forgetful" in n, yeah.13/04 14:58
copumpkinoh, well yeah13/04 14:58
Eduard_MunteanuAnd I don't want to keep 'n' as a _value_ around.13/04 14:58
copumpkinphantom types in type aliases don't work in haskell either13/04 14:58
copumpkinyou might be able to get away with marking it as abstract13/04 14:58
Eduard_MunteanuWhat does it do, actually?13/04 14:59
Eduard_Munteanu(abstract)13/04 14:59
copumpkinit just hides the implementation of something from the typechecker13/04 14:59
copumpkinso it can't normalize past whatever its external interface is13/04 14:59
Eduard_MunteanuHrm... nice. So it's something like 'postulate' but you can actually define it.13/04 15:00
copumpkinsort of, yeah13/04 15:00
* Eduard_Munteanu tries it...13/04 15:00
copumpkinor you just want to hide your implementation13/04 15:00
Eduard_MunteanuHm, but now I can't extract the underlying type from it.13/04 15:01
Eduard_MunteanuI'm looking for something like   newtype Forget a b = Something a13/04 15:02
Eduard_MunteanuThere doesn't seem to be a way to extract 'a' if I use abstract.13/04 15:02
copumpkinI think you can put any functions that need to be aware of the innards into the abstract block too13/04 15:02
copumpkinjust write abstract13/04 15:02
copumpkinnew line13/04 15:02
copumpkinindent13/04 15:02
Eduard_MunteanuOh.13/04 15:02
copumpkinthen write your definition and other functions that are aware of the internals in there13/04 15:02
Eduard_MunteanuWait! That defeats the purpose if I put readSTVec in there.13/04 15:03
Eduard_MunteanuI presume it still won't unify the two constraints.13/04 15:04
copumpkinif you're interfacing with an unsafe external library, you're going to have to write vaguely unsafe code somewhere13/04 15:04
copumpkinthe point is to provide a safe interface to your users13/04 15:04
copumpkingotta go :)13/04 15:07
xplatA related thing is that UIP is provable for all types with decidable equality.13/04 15:10
xplat^^^ from 'Just Kidding: Understanding Identity Elimination in Homotopy Type Theory | Homotopy Type Theory'13/04 15:10
Eduard_Munteanudata STVec (s : Set) (a : Set) : ℕ → Set where    mkSTVec : {n : ℕ} → Prim.STArray s Prim.Int a → STVec s a n13/04 15:11
Eduard_MunteanuThat seemed to do the trick ^13/04 15:11
Eduard_MunteanuLet's see if it's still unsafe or not.13/04 15:12
xplatit seems like a circle interpreted as a type should have decidable equality since it is connected.  but it has non-homotopic paths (if you leave the endpoints fixed).  so it should not have UIP.  what am i not getting?13/04 15:12
Eduard_MunteanuYep, it works.13/04 15:13
xplatcool.  that index might still be alive at runtime though unless you mark it irrelevant somehow though?  (not sure)13/04 15:15
Eduard_MunteanuIs it present as actual data? I thought if I used an implicit param it wouldn't.13/04 15:15
Eduard_MunteanuI don't want it anywhere in the resulting program :)13/04 15:16
xplatimplicit means it's not present in the source.  irrelevant means it's not present in the compiled program.13/04 15:16
xplatthey're pretty much unrelated.13/04 15:17
Eduard_MunteanuHm. Maybe I can move ℕ to the left side of ':' in the data declaration.13/04 15:17
Eduard_MunteanuYep, that did it.13/04 15:18
Eduard_Munteanudata STVec (s : Set) (a : Set) (n : ℕ) : Set where     mkSTVec : Prim.STArray s Prim.Int a → STVec s a n13/04 15:19
Eduard_Munteanuxplat: so I suppose I can be sure it's irrelevant now, right?13/04 15:19
xplater ... maybe?13/04 15:35
Saizanthe second J is easy once you succumb to proving an identity law for trasitivity of Id13/04 15:36
copumpkinthe latest blog post on homotopy type theory actually made sense to me13/04 15:40
copumpkinI was amazed13/04 15:40
Saizanme too! though that's the only thing i remember13/04 15:41
Eduard_Munteanupumpkin: 'data' worked    data STVec (s : Set) (a : Set) (n : ℕ) : Set where     mkSTVec : Prim.STArray s Prim.Int a → STVec s a n13/04 16:07
Eduard_MunteanuThanks pumpkin and xplat. I'll remember 'data' as some an alternative to newtype then.13/04 16:07
Eduard_MunteanuAlthough I'm pretty sure it still adds some overhead unlike newtype.13/04 16:08
* Eduard_Munteanu needs to figure out how Rel works.13/04 17:07
Eduard_MunteanuUh, this is killing me...13/04 18:05
Eduard_MunteanuI just want a function _≥1 which typechecks only if its argument is a non-zero natural.13/04 18:05
Eduard_MunteanuSeemingly both 'pred zero' and 'Fin zero' typecheck :(.13/04 18:05
pumpkin?13/04 18:06
pumpkinFin zero is just uninhabited13/04 18:06
pumpkinthe statement itself isn't bad13/04 18:06
Eduard_MunteanuOh.13/04 18:06
pumpkinI can talk about false13/04 18:06
pumpkinthat doesn't mean I can prove it13/04 18:06
Eduard_MunteanuBut still I'm having difficulties wrapping my head around it.13/04 18:06
Saizanand pred zero = zero13/04 18:06
Eduard_MunteanuYeah pred zero = zero   so I can't really do succ . pred to prove something is nonzero13/04 18:07
Eduard_MunteanuHow should I approach this? It's getting hella hard even expressing simple constraints.13/04 18:08
pumpkinyou can ensure something is nonzero by always using it's successor :)13/04 18:08
pumpkin*a successor13/04 18:08
Eduard_MunteanuBut then I end up with the wrong type. I want something like this...13/04 18:08
Eduard_MunteanunewArray : ∀ {s} {a : Set} → a → (n : ℕ) → ST s (STVec s a (n ≥1))13/04 18:08
pumpkinwhat's the problem with having 0 there?13/04 18:09
Eduard_MunteanuWell I want it to represent the length of the array.13/04 18:09
pumpkinI can have an empty array13/04 18:09
Eduard_MunteanuIt won't be empty anyway.13/04 18:09
Eduard_Munteanu:t newArray13/04 18:10
lambdabotNot in scope: `newArray'13/04 18:10
Eduard_MunteanuI'm calling this in Haskell     newArray :: (MArray a e m, Ix i) => (i, i) -> e -> m (a i e)13/04 18:10
Eduard_Munteanu(specialized to i = Int)13/04 18:10
pumpkin(0,0)13/04 18:10
Eduard_MunteanuBut that's not empty, is it?13/04 18:10
Saizanthe usual way to forbid 0 would be: newArray : ∀ {s} {a : Set} → a → (n : ℕ) → ST s (STVec s a (suc n))13/04 18:11
pumpkinyeah, that's what I was saying before13/04 18:11
pumpkin(n-1: Nat) -> ST s (STVec s a (suc n-1))13/04 18:11
pumpkin:P13/04 18:11
pumpkinor you can actually ask for an explicit proof that it isn't 013/04 18:11
Eduard_MunteanuHeh I wish that was possible.13/04 18:11
Saizanyou give me n, i give you a vec of length (n+1)13/04 18:11
pumpkinEduard_Munteanu: it is13/04 18:11
pumpkinn-1 is a name13/04 18:12
Eduard_MunteanuHeh.13/04 18:12
pumpkinyou can ask for an implicit proof of T (n /= 0)13/04 18:12
pumpkinstill, I don't see why you want to forbid 013/04 18:13
Eduard_MunteanuHow? I've tried messing around in implicit args with stuff like that, but :/13/04 18:13
Eduard_Munteanupumpkin: because n = 1 and n = 0 are essentially the same...13/04 18:13
Eduard_MunteanunewArray x n = Prim.newArray (Prim.primNatToInteger 0) (Prim.primNatToInteger ∘ pred $ n) x >>= return ∘ mkSTVec13/04 18:13
Saizan?type listArray13/04 18:14
lambdabotforall i e. (Ix i) => (i, i) -> [e] -> Array i e13/04 18:14
Saizan> listArray (0,0) []13/04 18:14
lambdabot  array (0,0) [(0,*Exception: (Array.!): undefined array element13/04 18:14
pumpkinlol13/04 18:14
Saizan> listArray (0,-1) []13/04 18:14
lambdabot  array (0,-1) []13/04 18:14
Saizanyay.13/04 18:14
pumpkinyay indeed13/04 18:14
Eduard_MunteanuThat's a creepy array.13/04 18:15
Saizananyhow, just use "newArray : ∀ {s} {a : Set} → a → (n : ℕ) → ST s (STVec s a (suc n))" if you only want non-empty arrays13/04 18:15
Eduard_MunteanuYeah I suppose I could, but sorry for pestering you guys, what do I do every time I want to constrain a function? Change the semantics of my datatype?13/04 18:16
pumpkinif you want it to be pleasant, yes13/04 18:16
pumpkinotherwise, ask for explicit proofs13/04 18:17
Eduard_MunteanuHow would I do that, btw?13/04 18:17
SaizannewArray : ∀ {s} {a : Set} → a → (n : ℕ) → (n > 0) -> ST s (STVec s a n)13/04 18:17
Eduard_MunteanuOh.13/04 18:17
Eduard_MunteanuI kinda need to understand Rel a bit though.13/04 18:17
Saizanit's just a shorhand for A -> B -> Set13/04 18:18
Eduard_MunteanuI wish there was a way to say  f : Type ; oh and by the way Agda, try to prove that [...]13/04 18:18
Eduard_MunteanuThanks, I'll try to do that and see where that leads me.13/04 18:19
Saizanagda will infer the proof for you for the unit type, so you can use the T (decidabelPredicateHere) trick13/04 18:19
Eduard_MunteanuHm, that sounds like something I want.13/04 18:20
Saizanwhich works only if the arguments for the decidable procedure are sufficiently instantiated though, otherwise you still ahve to provide the proof explicitly13/04 18:20
SaizanT : Bool -> Set; T true = \top; T false = \bot13/04 18:20
Eduard_MunteanuSaizan: yeah I kinda want it to work for number literals for the moment13/04 18:20
SaizannotZero : Nat -> Bool; notZero zero = false; notZero (suc _) = true13/04 18:21
SaizannewArray : ∀ {s} {a : Set} → a → (n : ℕ) → {_ : T (notZero n)} -> ST s (STVec s a n)13/04 18:21
Eduard_MunteanuOh, thanks! That looks exactly like what I want.13/04 18:22
Eduard_MunteanuBut how exactly does T false = \bot work?13/04 18:24
Eduard_MunteanuIsn't that like a partial definition?13/04 18:24
pumpkinremember, I said that we can talk about falsity without being able to prove it13/04 18:25
Eduard_MunteanuOh right, \bot has no inhabitants and I'm using T as a type operator.13/04 18:25
* Eduard_Munteanu looks in the standard lib for this stuff...13/04 18:25
Eduard_MunteanuNiiiice! Although the error is a bit cryptic when I try to call it the wrong way.13/04 18:34
Eduard_MunteanuI simply get "Unsolved metas at the following locations [...]"13/04 18:34
pumpkinyeah13/04 18:36
pumpkinit's an implicit value of \bot :P13/04 18:36
pumpkinno wonder it can't find one13/04 18:36
Eduard_MunteanuI wonder how this plays out once I feed actual user input to it. I suppose I have to prove it's >0 to Agda.13/04 18:38
pumpkinthat's where Dec comes in13/04 18:38
Eduard_MunteanuHm, it seems that allows me to reflect value-level branches into the type system so Agda can see I validated user input, right?13/04 18:41
pumpkinDec is a fancy boolean where true carries a proof that it's true, and false carries a proof that it's false13/04 18:41
pumpkinit being whatever statement Dec is passed13/04 18:41
Eduard_MunteanuI see. Agda once again lived up to the expectations :)13/04 18:42
augurpumpkin! :D13/04 18:43
Eduard_MunteanuCan this ever work?   syntax Fun₂ (t₁ : T) (Fun₂ {_ : p} t₂) = (t₁ ∷ T) ⊢ p → t₂13/04 19:27
Eduard_MunteanuI'm getting a strange parse error right before ':'13/04 19:27
Eduard_MunteanuExample:    newArray : ∀ {s} {a : Set} → a → (n ∷ ℕ ⊢ (n > 0)) -> ST s (STVec s a n)13/04 19:29
Eduard_MunteanuWhat do you guys think?13/04 19:29
Eduard_MunteanuErm, that should've been: ∀ {s} {a : Set} → a → n ∷ ℕ ⊢ (T (n > 0)) → ST s (STVec s a n), but you get the point13/04 19:31
copumpkinwhat's the parse error?13/04 19:32
Eduard_MunteanuParse error t₁<ERROR> : T) (Fun₂ {_ : p} t₂) = (t₁ ...13/04 19:32
copumpkinlooks like something with the line before it?13/04 19:33
Eduard_MunteanuNope, if I comment out just the syntax line it loads.13/04 19:33
copumpkinI don't know how syntax declarations work13/04 19:34
Eduard_MunteanuMaybe I should break my syntax into two parts, one for _ ∷ _ ⊢ _, one for the rest?13/04 19:34
copumpkinI should probably figure it out at some point13/04 19:34
Eduard_MunteanuYeah, it's kinda new :/13/04 19:34
Eduard_MunteanuIt works for defining 'do' notation though.13/04 19:34
Eduard_Munteanusyntax bind e₁ (λ x → e₂) = x ← e₁ , e₂13/04 19:35
Eduard_MunteanuWhere 'bind' is an alias for >>= (but you can't use _>>=_ directly according to the release notes)13/04 19:36
augurahh you can define syntax?13/04 20:00
Eduard_Munteanuaugur: yep, since Agda 2.2.813/04 20:04
Eduard_MunteanuSyntax stuff gives me headaches :(13/04 21:52
Eduard_MunteanuOMFG!13/04 22:12
Eduard_MunteanuI think it worked:   newArray : ∀ {s} {a : Set} → a → n ∷ ℕ ⊢ (λ x → x ≥1) ⇒ (ST s (STVec s a n))13/04 22:12
Eduard_MunteanuDo you guys think it makes sense, as a syntax?13/04 22:15
Eduard_MunteanuGah... what *can't* Agda do? :P13/04 22:21
xplatEduard_Munteanu: as a syntax that looks kind of weird to me13/04 22:29
xplatespecially with n NOT being a binder13/04 22:30
xplater, not being a binder in the left of the =>13/04 22:30
Eduard_Munteanuxplat: yeah I tried doing that but it seems I can't have two lambdas in a 'syntax'. Any ideas?13/04 22:31
Eduard_MunteanuCurrently it's    syntax restrict T₁ p (λ t₁ → t₂) = t₁ ∷ T₁ ⊢ p ⇒ t₂13/04 22:31
Eduard_MunteanuI can't tell how to make it accept    syntax restrict T₁ (λ t₁ → p) (λ t₁ → t₂) = t₁ ∷ T₁ ⊢ p ⇒ t₂13/04 22:33
Eduard_MunteanuMaybe I should split it into two syntax declarations but I'm unsure if it's possible.13/04 22:35
xplatwhat's wrong with ∀ {s} {A : Set} → (a : A) (n : ℕ) → (n ≥1) → (ST s (STVec s a n))?13/04 22:35
xplator for that matter why do you not want to allow empty arrays?13/04 22:35
kosmikusyes, I wanted to ask that too. why the whole >= 1 thing?13/04 22:36
Eduard_MunteanuMm, mainly because pred zero = zero so if I use Nats I won't really have empty arrays.13/04 22:36
Eduard_Munteanu(and this syntax thingy sounded like an interesting thing :) )13/04 22:36
xplati think this will turn out to bite you later when you end up having to include n ≥1s all over the place when you use the library13/04 22:37
kosmikusI don't understand the remark about pred ...13/04 22:37
Eduard_Munteanu:t Data.Array.MArray.newArray13/04 22:37
lambdabotforall i e (m :: * -> *) (a :: * -> * -> *). (Data.Array.Base.MArray a e m, Ix i) => (i, i) -> e -> m (a i e)13/04 22:37
xplaton the haskell side it's an integer, right?  so why not subract 1 there?13/04 22:38
Eduard_MunteanuInt yeah. Hm, I actually could, and end up with (0, -1) as bounds, therefore an empty array.13/04 22:38
copumpkinor use a sane, non-Ix-based array13/04 22:39
copumpkinlike repa or vector13/04 22:39
copumpkinI started writing repa in agda a while back13/04 22:39
copumpkinit's so much nicer13/04 22:39
Eduard_MunteanuActually I thought about this a bit and it seems difficult to cut out portions of various sets, or make your own, so I considered abstracting with this syntax.13/04 22:39
copumpkinwell, nicer in that the shapes make a lot more sense13/04 22:39
Eduard_MunteanuHm, REPA sounds good.13/04 22:40
Eduard_MunteanuWell my main reason was to experiment with bounds checking elimination.13/04 22:40
Eduard_Munteanuvia dependent typing13/04 22:40
copumpkinyeah, same here :P13/04 22:40
copumpkinmy repa shapes are lists of naturals13/04 22:40
Eduard_MunteanuOh. But I suppose REPA uses GHC Arr stuff.13/04 22:41
copumpkinand I have an index indexed by a shape13/04 22:41
kosmikuswell, I think if you use indices, you should use half-open intervals at least13/04 22:41
copumpkinwith fins inside13/04 22:41
kosmikusi.e., interpret (5,10) as [5..10), i.e., [5..9]13/04 22:41
Eduard_Munteanucopumpkin: by shape somehow you mean something that might not be regular (like a matrix)?13/04 22:41
copumpkinno, in this case it's regular13/04 22:42
copumpkinI also started experimenting with a fully statically checked version of dph's non-regular arrays13/04 22:42
copumpkinbut that was getting ugly so I stopped13/04 22:42
copumpkinlet me see if I have that code on this computer13/04 22:42
Eduard_Munteanukosmikus: ah, the indices are merely for GHC's arrays which I use as a backend13/04 22:43
copumpkinhmm, it's not on this computer13/04 22:43
Eduard_MunteanuShould I look on your Github stuff?13/04 22:44
copumpkinI didn't put it up there either13/04 22:44
copumpkinit was super ugly13/04 22:44
copumpkinit isn't a binding to repa13/04 22:44
Eduard_Munteanu(Though I'll probably do it anyway some time, to see your CT stuff)13/04 22:44
copumpkinit's an attempt to prove things about how repa does things13/04 22:44
Eduard_MunteanuOh.13/04 22:44
copumpkinbut anyway13/04 22:44
copumpkinI basically had something like13/04 22:44
copumpkindata Shape : Nat -> Set where13/04 22:44
copumpkin[] : Shape 113/04 22:44
copumpkin_::_ : (n : Nat) -> Shape m -> Shape (n * m)13/04 22:45
xplat{n : Nat} ?13/04 22:45
xplatowait13/04 22:45
copumpkin{m : Nat}13/04 22:45
copumpkinyeah13/04 22:45
copumpkinthen13/04 22:45
copumpkindata Index : {n : Nat} -> Shape n -> Set where13/04 22:46
Eduard_MunteanuNeat.13/04 22:46
copumpkin[] : Index []13/04 22:46
copumpkin_::_ : {n m : Nat} {x : Shape m} -> Fin n -> Index x -> Index (n :: x)13/04 22:47
copumpkinor something like that13/04 22:47
copumpkinmay be off-by-one errors or so13/04 22:47
copumpkinbut then you have an arbitrary-dimensionality typesafe index13/04 22:47
copumpkinand the Shape tells you how big your array is13/04 22:47
copumpkinthen I had a flatten and unflatten function13/04 22:47
copumpkinthose were a pain to write13/04 22:47
Eduard_MunteanuMm, nice, and you don't keep values around.13/04 22:48
copumpkinso basically flatten :: {m : Nat} {s : Shape m} -> Index s -> Fin m13/04 22:48
copumpkinand unflatten :: {m : Nat} {s : Shape m} -> Fin m -> Index s13/04 22:48
copumpkincrazy div/mod happening in the latter one, obviously13/04 22:48
copumpkinflatten was itself rather ugly13/04 22:48
copumpkinI'll put it online when I get home to my other computer, if I can find it13/04 22:49
xplatwhen do you need unflatten?13/04 22:49
copumpkinnot sure, maybe even never13/04 22:49
copumpkinbut if you write a function like that in one direction, the obvious challenge is to go the other way :P13/04 22:50
copumpkinI then started thinking about n-dimensional slices, but then lost interest13/04 22:50
copumpkindoing full dph-style arrays would be lots of fun13/04 22:51
xplati guess you could use it to prove that Index {n} _ is always iso to Fin n13/04 22:51
copumpkinyeah13/04 22:51
Eduard_MunteanuMm, there should be more stuff in the stdlib.13/04 22:51
Eduard_MunteanuI'd try to get some stuff merged if I get it done and it's useful.13/04 22:52
copumpkinI think NAD is reluctant to add more stuff to it, as it already has lots of stuff in it13/04 22:52
copumpkinEduard_Munteanu: are you looking at Everything.agda?13/04 22:52
copumpkincause the default readme shows you only a tiny tiny cross-section of what's there13/04 22:53
Eduard_MunteanuMm, I'm just including individual modules, not using that.13/04 22:53
copumpkinhttp://www.cse.chalmers.se/~nad/listings/lib/Everything.html#113/04 22:53
xplatso before stuff is added to the stdlib, the stuff that's already in there needs to be documented?  :-713/04 22:54
copumpkinpff documentation13/04 22:54
copumpkinyou have types13/04 22:54
Eduard_MunteanuHeh.13/04 22:54
Eduard_MunteanuAnd types have types in case that's not clear :P13/04 22:54
xplattypes-as-documentation only substitute for javadocs, not real docs13/04 22:55
copumpkinhttp://snapplr.com/q47q what could be clearer13/04 22:55
xplatsomething has to tell you which signatures to read :P13/04 22:55
copumpkinpfff13/04 22:56
copumpkinreal men read the types in memory, with a debugger13/04 22:56
copumpkinhere you go13/04 22:57
xplatyou mean 'real men psychically read the erased types from the memory they would apply to?'13/04 22:57
copumpkinhttps://patch-tag.com/r/gallais/agda/snapshot/current/content/raw/src/presburger/Cooper.agda13/04 22:57
copumpkinenjoy :P13/04 22:57
Eduard_MunteanuUh, Firefox doesn't see that's UTF8.13/04 23:02
* Eduard_Munteanu should wget it.13/04 23:02
copumpkinyeah, apparently the server is sending it as some other encoding13/04 23:02
Eduard_MunteanuBut what's it anyway? Looks like a huge pile of abstracts.13/04 23:02
copumpkinjust tell your browser what encoding it is13/04 23:02
copumpkinit's a presburger arithmetic solver!13/04 23:02
Eduard_MunteanuMrm... indentation could be better :P13/04 23:04
xplatit seems very ... terse13/04 23:04
copumpkinI look forward to it being done :)13/04 23:05
xplatof course i'm reading it in elinks, it might be more readable with color highlighting13/04 23:06
augurcopumpkin! :D13/04 23:24
augurcopumpkin: updated the repo13/04 23:30
augurwith definitions for inclusiveness and derivationality!13/04 23:30
augur:D13/04 23:30
--- Day changed Thu Apr 14 2011
Eduard_MunteanuIs it possible to use more than 1 lambda on the left hand side of '=' in a 'syntax' declaration?14/04 21:18
Eduard_MunteanuI'd like to bring a name into the scope of multiple terms.14/04 21:18
Eduard_MunteanuSay doing the same for 'p' in   syntax restrict T₁ p (λ t₁ → t₂) = t₁ ∷ T₁ ⊢ p ⇒ t₂   (though this is just an example)14/04 21:19
Eduard_Munteanu(I'd like to bring 't₁' into p's scope as well I mean)14/04 21:20
xplatEduard_Munteanu: couldn't you just increase the scope of the existing lambda?  (would require changing the definition of restrict tho)14/04 21:55
Eduard_Munteanuxplat: hm, maybe something like syntax restrict T₁ (λ t₁ → (p, t₂)) = ...   works, I'll try it, thanks.14/04 22:08
Saizansyntax restrict T₁ (λ t₁ → t₂) = t₁ ∷ T₁ ⊢ t₂; _⇒_ = _,_; would make sense14/04 22:11
Eduard_MunteanuYeah, but I think you're considering a different use for those symbols. t₁ ∷ T₁ ⊢ p ⇒ t₂ in my case meant (t₁ : T₁) → {_ : T (p t₁)} → t₂14/04 22:22
Eduard_MunteanuIOW it builds a set from an existing one and a predicate that filters it.14/04 22:23
Saizanrestrict : (T1 : Set) -> (T1 -> Bool x Set) -> Set; restrict T1 f = (t1 : T1) -> {_ : T (proj\_1 (f t1)} -> proj\_2 (f t1)14/04 22:26
Saizani guess i shouldn't have reused t₂ in the code above, since i really meant something else14/04 22:27
Saizanp = proj\_1 (f t1); t₂ = proj\_2 (f t1), with my version14/04 22:29
Eduard_MunteanuHm, my original one was   restrict : ∀ (A : Set) → (A → Bool) → (A → Set) → Set       restrict T₁ p t₂ = ∀ (a : T₁) → {_ : T (p a)} → (t₂ a)14/04 22:29
Eduard_MunteanuOh I guess that'd work by collapsing (A → Bool) → (A → Set) into (A → Bool x Set), nice.14/04 22:30
Eduard_MunteanuI hope Agda will find the lambda in 'syntax' correct.14/04 22:30
Eduard_MunteanuGrr, it doesn't like    syntax restrict T₁ (λ t₁ → (p , t₂)) = t₁ ∷ T₁ ⊢ p ⇒ t₂14/04 22:33
Eduard_MunteanuIt spits out a cryptic parse error: Parse error (<ERROR>p , t₂)) = t₁ ∷ T₁ ⊢ p ⇒ t₂ -...14/04 22:34
Eduard_MunteanuWait, I see what you meant now by  _⇒_ = _,_14/04 22:35
Eduard_Munteanu:)14/04 22:35
Saizanright, you should put ,/⇒ in the syntax declaration14/04 22:36
Saizan*shouldn't14/04 22:37
Eduard_MunteanuThanks, Saizan, it worked.14/04 22:47
Eduard_MunteanuI can now write   newArray : ∀ {s} {a : Set} → a → n ∷ ℕ ⊢ nonZero n ⇒ ST s (STVec s a n)14/04 22:47
Eduard_MunteanuEven better, as an alternative... newArray : ∀ {s} {a : Set} → a → ⟨ n ∈ ℕ ∥ nonZero n ⟩ ST s (STVec s a n)14/04 22:51
Eduard_MunteanuI'm trying to define a category like this: http://hpaste.org/45695/categories14/04 23:10
Eduard_MunteanuBut I'm getting an error on 'arr a a'. Any ideas?14/04 23:10
Eduard_MunteanuArr !=< _12 Ob Arr arr of type Set when checking that the expression arr a a has type _12 Ob Arr arr14/04 23:11
Saizanwell, Arr is not Set :)14/04 23:14
Saizantake "arr : Ob -> Ob -> Set" and do away with Arr14/04 23:14
Eduard_MunteanuHm, but I figure for different categories one has different arrow types. Any way I can encode that?14/04 23:16
Eduard_MunteanuFor example in Sets they're normal functions.14/04 23:16
Eduard_Munteanu(once I introduce universe polymorphism of course)14/04 23:16
Saizansure, but arr is the arrow type14/04 23:16
Eduard_MunteanuOh.14/04 23:17
Eduard_MunteanuRight, Arr is redundant. Thanks.14/04 23:17
* corpumpkin stole dolio14/04 23:21
* corpumpkin laughs evilly14/04 23:21
Saizan?14/04 23:28
Saizanhttp://code.google.com/p/agda/issues/detail?id=291 <- nice when people talk with code :)14/04 23:28
corpumpkinSaizan: he's staying at my apartment!14/04 23:29
* Saizan fears for him14/04 23:32
corpumpkin:D14/04 23:37
djahandarieOh, he's in Boston now?14/04 23:39
corpumpkinyep14/04 23:43
--- Day changed Fri Apr 15 2011
Eduard_MunteanuHow do I set fixity for record fields? infix gives a parse error.15/04 00:08
Saizanyou probably have to do it inside the record declaration15/04 00:12
Saizananyhow, it's not fair that asking if some way of fixing a bug makes sense results in the bug being fixed, now i need to find something else to do15/04 00:36
xplatyeah, who the hell do they think they are, fixing bugs and stuff?  :)15/04 00:36
Eduard_MunteanuWell, yeah that's what I'm doing: http://hpaste.org/45699/categories_215/04 00:49
Eduard_MunteanuParse error infixr<ERROR> 40 _⟨∘⟩_ _⟨∘⟩_ : ∀ {a b c...15/04 00:50
SaizanEduard_Munteanu: put it after the field part, indented like field, rather than like the fields15/04 00:59
Eduard_MunteanuThanks, that seems to do it.15/04 01:04
Saizanthe stuff that you put there gets moved to the autogenerated module for the record, you can put anything you could put in a module, e.g. functions, datatypes, etc15/04 01:11
Eduard_MunteanuOh I see.15/04 01:13
Eduard_MunteanuIs there any way to do implicit composition, somewhat like view patterns? Say I have _≃_ : S → S → Bool, and I want to define it as if it were S -> S -> Bool and compose with T on the left.15/04 01:25
Eduard_MunteanuMm, maybe I can do it with 'syntax'.15/04 01:26
Eduard_MunteanuHow would one encode function equality? I'm looking to prove Set is a category and I kinda need an arrow equivalence.15/04 02:41
Eduard_MunteanuUh, I guess even equality of normal values is troublesome under polymorphism in Agda, given there are no typeclasses :(15/04 02:47
SaizanRelation.Binary.PropositionalEquality ?15/04 02:48