--- Log opened Tue Mar 01 00:00:25 2011
djahandarieDoes the Epic backend run faster than the Haskell one?01/03 04:20
copumpkinfaster? what?01/03 04:21
djahandarie? Was that question ill-defined?01/03 04:21
copumpkinit presupposes that people run their agda programs01/03 04:21
djahandarieIs the compiling faster?01/03 04:22
copumpkinI can't say I've ever tried :)01/03 04:22
nappingor memory usage, for that matter01/03 04:24
nappingIt seems to take more than my laptop's 2GB to recheck the standard library01/03 04:24
copumpkinfor anyone interested, I proved lambek's theorem about f-algebras in agda01/03 04:24
nappinggot anything about presheaves?01/03 04:25
copumpkinnot yet :)01/03 04:25
copumpkinI can define one easily for you if you want ;)01/03 04:25
nappingI probably don't need them anyway, but I'll see01/03 04:25
nappingI'm trying to work out a way to do actor semantics that's not totally ugly01/03 04:25
copumpkin:O01/03 04:26
copumpkinwith presheaves?01/03 04:26
nappingI'd like to just use posets01/03 04:26
* djahandarie doesn't see the connection01/03 04:26
nappingbut it's a bit unclear how to impose fairness and things01/03 04:26
nappingso possibly labeling each event with a finite history01/03 04:26
nappingthen I'm pretty sure consistency between those would give a presheaf structure01/03 04:27
nappingnot an especially fancy sheaf, mind you.01/03 04:27
copumpkinnapping: we started a ##categorytheory a couple of days ago btw, if you're interested in yet another channel01/03 04:27
copumpkinit's surprisingly talkative01/03 04:28
djahandarieProbably just sapping all the category theory out of #haskell01/03 04:28
copumpkin:P01/03 04:28
copumpkinyep01/03 04:28
nappingwait, did I get an arrow backwards?01/03 04:28
nappingwell, the C vs. C-op things doesn't matter much, as the event order doesn't have too much structure01/03 04:28
nappinghopefully that sort of device isn't needed anyway01/03 04:29
nappingthough it would still beat the heck out of the arbitrary global order that seems to be the usual tool01/03 04:29
nappingI probably should formalize my model01/03 04:33
nappingthere are some claims that make me doubt how constructive the theory actually is01/03 04:33
copumpkinnapping: I added presheaves ;)01/03 04:33
nappingwhere is the code?01/03 04:33
copumpkinhttps://github.com/pumpkin/categories/blob/master/Category/Presheaf.agda :P01/03 04:34
* copumpkin runs away01/03 04:34
Saizanheh, such a big name..01/03 04:36
copumpkin:P01/03 04:36
copumpkinyou should see my bifunctor.agda! ;)01/03 04:36
Saizanah! that's clearly copied from mine!01/03 04:37
copumpkinlol01/03 04:38
nappingI see a lot of empty modules01/03 04:38
copumpkinyou wrote one too?01/03 04:38
copumpkinnapping: I have a full-time job! :P01/03 04:38
nappingis there an index?01/03 04:38
copumpkineverything.agda, but it lists the ones that are empty too :P01/03 04:38
Saizanyeah, in ctfp01/03 04:38
copumpkinI can tell you what I have so far01/03 04:38
nappingI means one that says what you plan to put in them01/03 04:39
nappingso that sounds right01/03 04:39
copumpkinah okay01/03 04:39
copumpkinthe README also lists my goal01/03 04:39
nappingIt took me a few to notice - it seemed plausible Preorder might be empty01/03 04:39
copumpkinI actually have the code for that sitting in Category.agda01/03 04:39
copumpkinnot sure why I don't just move it over01/03 04:39
copumpkinanyway, most of my time so far has been spent on all the pre-requisites for the 2-category of categories01/03 04:41
copumpkinI have all but one piece (except for an actual structure for 2-categories, but I'm not as interested in that right now)01/03 04:41
greapI'm trying to install agda with cabal and it seems to be depending on two different versions of bytestring...01/03 11:35
greapzlib depends on bytestring-, but everything else depends on bytestring- 11:37
ccasingreap: this kind of dependency problem crops up occasionally with cabal01/03 12:34
ccasinI don't know the official way to resolve it, but typically I start by trying to install an older version of the package with the out-of-sync dependency01/03 12:34
ccasinin this case, zlib01/03 12:34
ccasinthough, looking at the hackage information, it doesn't look like the latest zlib should be demanding bytestring- 12:35
rribeiroHi everyone! Does someone knows any implementation of temporal logics in agda?01/03 22:25
--- Day changed Wed Mar 02 2011
roconnoranyone from nottingham awake?02/03 00:35
nappingcan a data type for something like lambda calculus be defined without an apply symbol?02/03 01:47
Mathnerd314application is a key part of the lambda calculus...02/03 03:23
greapthanks ccasin02/03 07:11
roconnoranyone from nottingham around?02/03 13:11
ccasinany #agda folks registering for the oregon PL summer school this time around?02/03 16:08
ccasinI think I'm going02/03 16:08
ccasinwas loads of fun last time I went, in 200802/03 16:08
copumpkinman, I'd love to02/03 16:08
copumpkinbut full-time job gets in the way of that :)02/03 16:09
djahandarieIsn't that, expensive or something? :P02/03 16:10
ccasinyeah, grad school is nice :)02/03 16:10
copumpkinccasin: in the right field, yep :P02/03 16:11
ccasinit's pretty cheap actually!  About $1000 including registration, a place to sleep, and meals for 2 weeks02/03 16:11
copumpkinwow02/03 16:12
djahandarieWow02/03 16:12
djahandarieThat is damn cheap02/03 16:12
copumpkinis it competitive?02/03 16:12
ccasincopumpkin: I don't really know, but I don't think so.02/03 16:13
ccasinand the roster of speakers/topics is pretty amazing this year, for those of us with an interestest in the foundations of dependent type theory :)02/03 16:14
djahandarieOh god, I only have 2 days left to decide whether I want to do this or not02/03 16:15
djahandarieErm02/03 16:16
djahandarieThey don't have a cost for registration for an undergraduate student. :P02/03 16:16
copumpkindjahandarie: do it!02/03 16:16
ccasin:) probably the same as a grad student, presuming you can get some faculty member to write a short recommendation02/03 16:16
ccasinI know some local oregon undergrads attend02/03 16:17
djahandarieAh, they do have instructions for bachelor's students under "registration"02/03 16:17
ccasinyou should come, it is seriously a blast02/03 16:19
djahandarieI just need to get a professor to write me a letter like, today02/03 16:19
ccasindjahandarie: yeah, but I don't think it has to be too serious.  I'm pretty sure if they send a paragraph saying you're an intelligent human being and like type theory, you'll be fine02/03 16:21
djahandarieHeh, okay.02/03 16:22
greapIs there a way to alias a datatype?02/03 16:48
greapSomething like, alias Nat = ℕ02/03 16:49
Saizanyou can just define Nat = ℕ02/03 16:50
ccasinCan you just write:02/03 16:50
ccasinN : Set02/03 16:50
ccasinN =  Nat02/03 16:50
ccasinor does aliasing apply something deeper?02/03 16:50
ccasin*imply02/03 16:50
ccasin(sorry, imagine my definition in whichever direction you meant :)02/03 16:51
greapThanks guys!02/03 16:52
greapI was confused by haskell experience :)02/03 16:53
ccasinyeah, types aren't special here.  hooray!02/03 16:53
djahandarieccasin, alright, I'm going to try and get into that summer school thing :)02/03 19:24
ccasinawesome!02/03 19:24
djahandarieI need to read up some on Coq though02/03 19:29
djahandarieIts syntax is still scary to me so I need to at least get that problem out of the way ;)02/03 19:30
ccasinI believe Benjamin is going to cover the introductory material in our software foundations book02/03 19:30
ccasinwhich will get you acquainted with coq02/03 19:31
djahandarieOh well, I'll do it anyways :P02/03 19:31
djahandarieI've been meaning to so this is just more of a reason to do it02/03 19:31
ccasinyeah, coq is pretty swell02/03 19:31
ccasinthough, for programming, it's no agda02/03 19:31
danrIs Pierce your lecturer?02/03 19:37
ccasindanr: he will be one of the lecturers at the oregon pl summer school, which we were talking about02/03 19:38
danrI see :)02/03 19:38
danrAre you PhD-students?02/03 19:39
ccasinI'm a phd student at u penn, but the summer school is open to undergrads, phd students, and others02/03 19:40
danrI see. I'm a MSc-student in Sweden, do you know if there is any scholarship/grant to apply for this summer school?02/03 19:41
danrI've heard about it before, you see, two of my friends (which are PhDs) are going.02/03 19:42
djahandarieI'm an undergraduate here02/03 19:42
djahandarieHopefully I manage to get in02/03 19:43
danrAre you going?02/03 19:43
djahandarieIt sounds like a lot of people are going!02/03 19:43
djahandariedanr, I'm writing an email at this moment02/03 19:43
djahandarieMaybe I'm just in the wrong channel to get a good gauge of just how many people actually know about this though ;)02/03 19:43
danrMaybe :)02/03 19:44
danrDo you think your university will finance it?02/03 19:44
djahandarieI don't know, don't plan on investigating that really. I have enough money that it doesn't really matter that much to me anyways :P02/03 19:45
djahandarieI don't think I'd be able to get the financing mainly because I'm a ugrad02/03 19:45
djahandarieI suppose I could be wrong though02/03 19:46
pumpkinooh look at rich djahandarie02/03 19:46
djahandariepumpkin, :P02/03 19:46
djahandarieI'm sure you have much more money than I do :P02/03 19:46
djahandarieI just don't have many expenses02/03 19:46
djahandarieSo I tend to not spend money and just pile it up02/03 19:46
djahandarieIt's a good life02/03 19:46
pumpkin:)02/03 19:46
pumpkinI still have piles of student loans02/03 19:47
djahandarieAh. :(02/03 19:47
danrdjahandarie: do you live in the US?02/03 19:47
djahandariedanr, yeah, Connecticut02/03 19:47
ccasindanr: there is some funding available, though I don't know anything about how it is distributed.  I think there is some information on the website02/03 19:47
danrccasin: You think so? I couldn't find anything02/03 19:48
ccasinthe registration page indicates that you can apply for grant money, but I really don't know anything else about it02/03 19:49
danrOh, yeah it does02/03 19:53
danrThanks02/03 19:53
--- Day changed Thu Mar 03 2011
danrI made a xmodmap file with unicode bindings for dvorak: http://hpaste.org/44489/dvorak_unicode_file (in case someone is interested)03/03 13:43
starcloudedhello everybody03/03 15:09
ccasinhi!03/03 15:10
copumpkindjahandarie: tsumaranai!03/03 17:05
copumpkindjahandarie: I don't recognize that first word, and the dictionary doesn't clear it up03/03 17:10
copumpkinprobably school of some sort? :P03/03 17:10
rribeiroHi everyone03/03 20:03
Saizanhi03/03 20:03
djahandariecopumpkin, oops03/03 20:03
rribeiroI need some help in proving a theorem03/03 20:03
djahandarieTyped it wrong03/03 20:03
djahandarieIt was suppose to be 授業03/03 20:03
rribeiroI'm trying to implement and prove in agda the unification algorithm of McBride's paper First order unification by structural recursion03/03 20:04
rribeiroand I have some doubts in how to  prove the pointwise equality for substitutions03/03 20:04
Saizanbetween which substitutions, specifically?03/03 20:06
rribeiroSaizan, the substitution is represented by a function of type : {m : N}(Fin m) -> Term m03/03 20:09
rribeiroSaizan, I want to prove this:03/03 20:09
rribeiro { n m : ℕ } → (f g : Fin m → Ty n) → (x : Fin m) → f x ≡ g x03/03 20:09
Saizanif you could prove that it'd mean that all the substitutions behave the same, which doesn't make sense03/03 20:11
Saizanwhat's a sensible thing to do is define pointwise equality as a type:03/03 20:12
Saizan_≐_ : {m n : ℕ} -> (Fin m -> Term n) -> (Fin m -> Term n) -> Set03/03 20:13
Saizanf ≐ g = ∀ x -> f x ≡ g x03/03 20:13
rribeiroohhh03/03 20:13
rribeiroSaizan, sorry... my bad!03/03 20:13
Saizannp :)03/03 20:13
Saizanare you implementing that algorithm as a learning exercise?03/03 20:15
rribeiroSaizan: yes... I'm learning Agda, and I have some interest in unification, type inference... So I'm trying to implement it and learn a bit about agda03/03 20:16
Saizannice03/03 20:17
xplati'd really like to have a nice way to enter tons of unicode math symbols quickly and easily03/03 20:51
danrare you using Linux?03/03 20:52
xplatagda's TeXlike way is not bad, but it's kind of fussy, it's easy to end up with the wrong symbol by mistake03/03 20:52
xplater, agda-mode's03/03 20:52
roconnorI wish I could enter unicode characters in Agda like I do in TeXmacs03/03 20:53
xplatand of course it doesn't work for irssi (to answer your other question in the affirmative, danr)03/03 20:53
roconnorTeXmacs has the best wysiwyg math entry system I've ever had the pleasure to use.03/03 20:53
xplati've tried using a scim input method based on latex, but it's actually pretty unusable03/03 20:54
danrI don't know about TeXmacs, sorry but I configured my X-keymap to have unicode characters with the alt+gr modifier earlier today: http://hpaste.org/44489/dvorak_unicode_file03/03 20:54
xplatthe w3-entities version is better, but it's too verbose03/03 20:54
xplatand still a lot of things not covered :(03/03 20:55
xplatalso it's hard to use with a window in the SE corner because scim pops up a status window there03/03 20:55
roconnorin texmacs you type key combinations and then you can use Tab to cylce through alternative interpretations03/03 20:56
roconnorSo a-Tab is alpha; A-Tab is forall -> is right arrow, etc.03/03 20:56
xplatand it's hard to switch between that and anthy (partly my own fault for having a lot of other input methods configured that i never use, but still ...)03/03 20:56
roconnorit sounds kinda dumb but it works very well03/03 20:57
xplatroconnor: sounds similar to IMs for japanese03/03 20:57
danrSo tab as suffix instead of \ as prefix?03/03 21:00
roconnordanr: I don't write out alpha, or RightArrow.03/03 21:01
roconnorusually a letter or two or three followed by some number of tabs03/03 21:01
danrroconnor: true, no completion in agda-mode as far as I know03/03 21:01
danrmaybe it's common knowledge, but \alpha is also on \Ga03/03 21:03
roconnorI didn't know that03/03 21:04
danras any greek character, \Gl \GS and so on03/03 21:06
Saizanand \-> for \RightArrow03/03 21:14
roconnorwow, this is way less annoying03/03 21:15
danror \to or \r even :)03/03 21:15
npouillardI use XCompose for those who are on linux (or inside X11 in OS X)03/03 21:36
npouillardit is much nicer than any emacs mode since it works in every application in X03/03 21:36
npouillardI can share my .XCompose file mostly generated using a Haskell file03/03 21:37
roconnornpouillard: how do you write blackboard bold N?03/03 21:38
npouillardroconnor: my compose key is the right ALT, <compose>|N03/03 21:40
npouillard03/03 21:41
npouillardit is a mostly ASCII looking encoding plus some key letters, like g or ' (α=ga, Λ=gL) for greek, r for reversed symbols (like ∀=rA, ∃=rE), c for centered (like ·=c.), b for backspace (‽=?b!)03/03 21:44
npouillardc is also for math*c*al like ℘03/03 21:45
npouillardb or | is for blackboard bold ℕ, ℍ, ℙ, ℚ, ℝ, ℽ...03/03 21:47
danrIs there a blackboard bold B in unicode?03/03 21:51
danrfor Bool, then03/03 21:51
npouillarddanr: I've not seen it but would be higly intersted if it were03/03 21:52
npouillard_ for subscript ₁₂ᵢ, ^ for super script ¹²ⁿ...03/03 21:52
Saizanis there a recommended paper on normalization by evaluation? especially wrt proving soundness03/03 23:36
--- Day changed Fri Mar 04 2011
xplatnpouillard: unfortunately XCompose doesn't work under Gtk, which overrides it with its own hardcoded compose table :(04/03 01:41
xplatotherwise i would be all over that04/03 01:41
TacticalGracewhere does it get the Agda emacs mode from?04/03 02:28
copumpkinit?04/03 02:30
copumpkinagda-mode locate04/03 02:31
copumpkinyou want a textmate one?04/03 02:31
copumpkinit basically keeps a ghci session open in the background and talks to it04/03 02:31
TacticalGracehmm, irc cut of my first half of the sentence04/03 02:31
TacticalGraceIf I install Agda with cabal install from Hackage04/03 02:31
TacticalGracewhere does it get the Agda emacs mode from?04/03 02:31
copumpkinif you type agda-mode locate04/03 02:31
copumpkinit'll tell you the location of the .el file04/03 02:31
TacticalGraceI just installed via cabal, but it still only has an older 2.2.6 version of the emacs mode04/03 02:31
copumpkinoh04/03 02:32
copumpkinthat seems odd04/03 02:32
copumpkincheck your .emacs file and see what it's loading04/03 02:32
TacticalGraceWithinReason chak 9 (/Users/chak): agda-mode locate04/03 02:32
TacticalGrace /usr/local/share/Agda-2.2.6/emacs-mode/agda2.el04/03 02:32
TacticalGracethat is what it is loading04/03 02:33
copumpkinhm04/03 02:33
TacticalGrace(the stuff put into .emacs also just runs agda-mode locate to find the file04/03 02:33
copumpkinyeah04/03 02:33
copumpkinoh, did you do a global install?04/03 02:33
TacticalGraceI don't remember where I used to get the emacs mode from04/03 02:33
copumpkinsince normally share is in ~/.cabal/share04/03 02:33
TacticalGracehmm, let me see04/03 02:34
copumpkinmine is /Users/pumpkin/.cabal/share/Agda-2.2.11/emacs-mode/agda2.el04/03 02:34
SaizanTacticalGrace: maybe the newly installed agda-mode exe is somewhere out of your PATH04/03 02:34
TacticalGracecopumpkin: Right!  That's it04/03 02:34
TacticalGracehmm, I probably installed the old version globally04/03 02:35
TacticalGracethat is one of the things I hate about cabal04/03 02:35
TacticalGracethanks04/03 02:38
copumpkinnp04/03 02:39
nappingIs there any way to indicate a partially applied function is supposed to get the next lazy argument?04/03 02:54
nappingI made a data _×_ (A : Set) (B : {a : A} → Set) : Set04/03 02:54
nappingand have (Exp × (λ {e2} → step e e2))04/03 02:54
copumpkinnext lazy argument04/03 02:55
copumpkin?04/03 02:55
nappingwith the pair defined like that it works nicely in non-dependent cases04/03 02:55
copumpkinoh, you mean the implicit argument?04/03 02:56
copumpkinI don't think so04/03 02:56
nappingI'm wondering if there's an alternative to (λ {e2} → step e e2)04/03 02:56
copumpkincan you write a Unimplicit f = \lambda {x} -> f x04/03 02:56
copumpkin?04/03 02:56
copumpkinnot sure if that works04/03 02:56
nappingmaybe, but bits are yellow04/03 02:59
nappingunimplicit : ∀{A B} → (f : (a : A) → B {a}) → {a : A} → B {a}04/03 02:59
copumpkinwhat are the unsolved metas?04/03 03:00
copumpkinjust set levels?04/03 03:00
nappingmore than that, it seems04/03 03:01
nappingunimplicit : ∀{A B} → (f : (a : A) → B {a}) → {a : A} → B {a}04/03 03:01
nappingthe body was a bit wrong04/03 03:02
nappingunimplicit {A} {B} f {x} = f x04/03 03:02
nappingleaves several unsolved metas04/03 03:02
nappingDoes "Sort" _NN mean a universe level?04/03 03:03
Saizanlikely04/03 03:03
Saizanit doesn't know if A is supposed to be Set or Set1 or Set2 ..04/03 03:04
Saizanor Set n for some quantified n04/03 03:04
nappingwell, it works labelled as04/03 03:04
nappingunimplicit : {A : Set} → {B : A → Set} → (f : (a : A) → B a) → {a : A} → B a04/03 03:04
nappingrather, typechecks04/03 03:04
nappingbut that "step" I wanted to partially apply is in Set\_104/03 03:05
copumpkinjust make it universe polymorphic04/03 03:05
nappingso, probably not worth doing this04/03 03:05
nappinga combinator will be just as long as writing an explicit lambda04/03 03:06
copumpkinI guess04/03 03:07
nappingshould that be added to "Agda2 Ghci Options"?04/03 03:09
copumpkinI just stuff {-# OPTIONS --universe-polymorphism #-} on the top of my files04/03 03:09
nappingthat sounds much better04/03 03:10
djahandarieIs universe polymorphism written about anywhere in papers? I've never seen the idea outside of Agda (albeit I don't do this stuff often)04/03 03:10
nappinghmm, it's turning yellow over the missing argument04/03 03:12
nappingthe argument that it's supposted to be making implicit04/03 03:12
Saizanheh04/03 03:13
Saizani find that higher order programming with implicit arguments is a pain04/03 03:14
nappingah04/03 03:15
nappingmy test definition had an implicit : bar : (e1 : Exp) → {e : Exp} → Set04/03 03:15
nappingso, with was taking an extra argument on the left, not expecting the right to be something that needed an implicit04/03 03:16
copumpkinwhat's annoying is that eta contraction doesn't work with implicits04/03 03:16
djahandarieIs it even legal to have an implicit argument in the middle of your arguments? I guess it is but is there a point?04/03 03:16
copumpkinsure there is04/03 03:17
copumpkina big pile of implicits is a pain to get at first of all04/03 03:17
copumpkinsecond your types might be built out of smaller building blocks04/03 03:17
copumpkinsome of which define implicit arguments04/03 03:17
copumpkinand aren't necessarily at the beginning04/03 03:17
nappingactually, it's probably nicer if your implicits are interspersed04/03 03:17
copumpkinyehah04/03 03:18
nappingso you don't have to write defn {_} {_} {_} {_} {_} {_} {implicitIReallyWanted} args = ...04/03 03:18
Saizankeyword arguments ftw04/03 03:18
nappingI wonder how far you could get just making free things implicitly quantified though04/03 03:18
nappingas things appear in the Epigram papers04/03 03:18
Saizantoo bad that C-c C-c happens to expand to that style04/03 03:18
nappingI don't know about keywords04/03 03:19
nappingI've never liked named things in formal systems04/03 03:19
Saizanfoo : {A : X} {B : Y} -> Y; foo {B = b} = b04/03 03:20
nappingall that alpha renaming04/03 03:21
Saizanyes, that's a big downside04/03 03:25
nappingwell, the Alpha (Ca)ML work seemed neat enough04/03 03:25
nappingthe "all but a finite number" quantifier seemed to work pretty well04/03 03:31
nappingbut FM set theory does refute the axiom of choice04/03 03:31
Saizani've never seen that04/03 03:36
nappingyou add atoms04/03 03:36
nappingand require that sets have finite or cofinite number of atoms04/03 03:37
nappingso for all but a finite number of pairs of atoms, swapping that pair leaves it alone04/03 03:37
dolioFM?04/03 03:38
nappingFraenkel Mostowski04/03 03:39
nappingIt's where alpha-caml got their swap04/03 03:40
dolioWikipedia doesn't appear to know about it at all.04/03 03:43
copumpkinhow can it exist then?04/03 03:44
nappinggoogle knows04/03 03:44
dolioThis paper reminds me a little of stuff I've heard about 'nominal sets.'04/03 03:58
Saizanah, right, i wanted to know what that nominal agda was about but the papers always drove me away04/03 04:00
dolioI haven't really looked into it.04/03 04:01
dolioBut from what I gather, it's for reasoning about binding and fresh variables and whatnot.04/03 04:01
Saizanyeah, i meant how it worked04/03 04:02
greapWhere does the name agda come from anyway?04/03 04:22
dolioI think it has to do with a European folk tale/legend/something.04/03 04:48
dolioI can't remember what it is, though.04/03 04:48
greapdolio: I haven't found any reference to it anywhere. It's quite strange! :D04/03 05:34
dolioWikipedia has an entry for a story involving an Agda. I'm not sure if that's the right one.04/03 05:35
nappingIs matching with wildcards primitve in agda?04/03 15:19
copumpkinnapping: how do you mean?04/03 15:20
nappingdoes a wildcard expand into many cases?04/03 15:20
copumpkinoh04/03 15:21
nappingThere's some discussion on coq-club about represnting chars with an inductive type with tons of constructors04/03 15:21
copumpkinouch04/03 15:21
copumpkinI'd hope not, but I dunno04/03 15:21
nappingalong similar lines, can the discrimination in "concon" be extened nicely to an equality test?04/03 15:23
Saizana wildcard can expand into many cases, it depends on how the rest of the patterns04/03 15:57
Saizans/how//04/03 15:58
nappingdepends on the rest of the patterns?04/03 16:03
nappingsay there is data T : Set where A B C D : T04/03 16:03
nappingis test A = true; test _ = false expanded into a match with four cases?04/03 16:04
Saizani'm not 100% sure, but considering that to prove anything about test you'll be able the 4 explicit cases i'd think so04/03 16:06
Saizans/be able/need/ -- not a good day for writing what i mean04/03 16:08
nappingSo, I guess things that can be written naturally with nonlinear patterns might expand to large cases04/03 16:20
Saizanyou mean with repeated non-dotted variables or overlapping cases?04/03 16:22
nappingyes, like eq a a = true ; eq _ _ = false04/03 16:23
nappingI'm trying the suggestion of building a conversion function to and from nat04/03 16:23
Saizanmaybe eq a a = .. could be rewritten as eq x y with decEq x y04/03 16:25
Saizaneasier to work with, i think04/03 16:25
nappingUsing my own data _≡_ {A : Set} (a : A) : A → Set , and the library maybe04/03 16:26
nappingfor some reason the first equality is yellow in ust-inj : {A : Set} {a b : A} → (just a) ≡ (just b) → a ≡ b04/03 16:26
nappinghaving trouble inferring the set04/03 16:26
Saizanweird, maybe you've more than one "just" in scope?04/03 16:27
nappingone thing is that I don't have --universe-polymorphism on04/03 16:27
Saizani don't think that matters04/03 16:28
nappingI think it's having trouble unifying my "Set" with any "Set a" from a module with universe polymorphism04/03 16:28
Saizanif you replace one just with Maybe.just it works04/03 16:31
SaizanData.Maybe exports Eq.just too04/03 16:31
nappingok04/03 16:33
xplatwhy would Data.Maybe export another just?  O_o04/03 22:48
Saizanbecause inventing new constructor names for same-shape structures is annoying :)04/03 23:05
--- Day changed Sat Mar 05 2011
starcloudedhello everybody05/03 17:26
copumpkinhi05/03 17:29
starcloudedanyone has a good web reference that list's logic Constructivist theorems and list's the classical theorems that can not be prove in Constructivist logic?05/03 17:32
starcloudedhello everybody05/03 17:59
starcloudedanyone has a good web reference that list's logic Constructivist theorems and list's the classical theorems that can not be prove in Constructivist logic?05/03 17:59
starcloudeddoes anyone?05/03 18:32
copumpkinstarclouded: I don't know of something that lists them05/03 18:41
copumpkinany of the obvious ones like double negation elimination or LEM05/03 18:41
copumpkinand half of demorgan05/03 18:41
copumpkinand iirc talking about surjectivity implies an inverse05/03 18:41
--- Day changed Sun Mar 06 2011
copumpkinafter talking about it with ddarius for a bit, I've decided to make my CT structures abstract!06/03 15:51
copumpkinin the sense of ADTs, and discouraging people from constructing the records themselves06/03 15:51
dolioNot in the abstract keyword sense?06/03 15:51
copumpkinthat way I can let people construct structures in a bunch of different ways without having them care about how I implemented it06/03 15:51
copumpkinADTs in the Abstract Datatype sense06/03 15:52
copumpkinsame with accessing properties about them06/03 15:52
copumpkinwe'll see how well it works out :P06/03 15:52
dolioIn that case I guess it's private keyword.06/03 15:53
copumpkinI'm not sure. Can I prevent someone from constructing a record explicitly?06/03 15:53
copumpkinor refining a hole to its record shape?06/03 15:54
dolioI don't know.06/03 15:55
copumpkinI'll play around with it later06/03 15:55
dolioIt seems even abstract doesn't prevent that.06/03 15:56
copumpkinmaybe I'll put in a feature request06/03 15:57
copumpkinalthough I guess it isn't the end of the world if I let people construct them :)06/03 15:57
dolioNope, there's no way.06/03 15:57
dolioIf you define 'private record Bar ...' and then export 'Baz = Bar', you can still enter a record.06/03 15:57
copumpkinah06/03 15:58
--- Log closed Sun Mar 06 21:52:26 2011
--- Log opened Sun Mar 06 21:52:33 2011
-!- Irssi: #agda: Total of 37 nicks [0 ops, 0 halfops, 0 voices, 37 normal]06/03 21:52
-!- Irssi: Join to #agda was synced in 73 secs06/03 21:53
--- Day changed Mon Mar 07 2011
djahandariecopumpkin, you should figure out how to work monoid transformers into your CT framework. (Reading this moggi paper and it sounds interesting)07/03 01:00
copumpkinI have lots of big plans and not much time :(07/03 01:01
copumpkinbut I'd like to07/03 01:01
djahandarie:(07/03 01:01
Saizanthere's a well defined concept of monoid transformers?07/03 01:10
djahandarieSaizan, I haven't read the whole paper but it looks like he works one out.07/03 01:11
Saizandjahandarie: name?07/03 01:12
djahandarie"Monad Transformers as Monoid Transformers" by Jaskelioff and Moggi07/03 01:13
Saizani guess i could've just googled :)07/03 01:14
xplatmonoid transformers?  i'm still trying to figure out what a monad transformer really is ... :(07/03 03:17
xplati mean, i can use them, but what are they categorically?07/03 03:18
dolioMonad morphisms, with some extras?07/03 03:23
nappingmore like functors07/03 03:28
nappingfunctors in the functor category07/03 03:29
nappingwith some extras07/03 03:29
Saizanhah, i'm using stricter types now: most of the code just works, the other gets simpler07/03 03:30
nappingwhat code are you working on?07/03 03:30
copumpkin:o07/03 03:30
nappingis anyone here using agda on windows?07/03 03:31
copumpkinI installed it on my work machine07/03 03:31
copumpkinI hate emacs on there with a passion though07/03 03:31
Saizanhttp://code.haskell.org/~Saizan/unification/Unify.agda <- started from this, and i'm replacing Term : Nat -> Set with Term : List Type -> Type -> Set currently07/03 03:31
copumpkinbut I got it to typecheck my category theory library07/03 03:31
dolioYeah, it's not a morphism of monads. I guess it'd have to be a functor on the relevant category of monads.07/03 03:31
nappinghmm, the emacs part didn't seem to bad07/03 03:31
copumpkinno, I mean I hate emacs in general07/03 03:31
copumpkinaquamacs is bearable07/03 03:31
nappingI'm just waiting a bit for the new platform07/03 03:31
copumpkinso I don't mind doing it on my mac07/03 03:32
copumpkinbut in general I'm not a fan07/03 03:32
dolioA monad transformer F : Mon -> Mon has an associated monad (T, eta, mu), and F(T', eta', mu') is a weak coproduct of (T, eta, mu) and (T', eta', mu').07/03 03:32
nappingWhat else would you want to use?07/03 03:33
dolioSomething like that.07/03 03:33
copumpkinnapping: I wouldn't mind vim as much, but not sure how good it is for custom things like holes07/03 03:33
nappingwrite an IDE in Agda?07/03 03:33
copumpkinwell, an IDE for agda might be nice07/03 03:33
copumpkinbut in agda sounds rather painful :P07/03 03:33
nappingI recall a "web browser"07/03 03:33
copumpkinoh, letting gtk do all the hard parts07/03 03:34
copumpkinand gluing it to gether in agda?07/03 03:34
Saizansomething like that, iirc07/03 03:34
nappingpostulate gtkWindowNew :: IO GtkWindow, etc.07/03 03:34
nappinger, one :07/03 03:34
nappingIt was using the Haskell bindings07/03 03:34
nappingI had GHC, but Agda needs happy07/03 03:38
Saizancabal install happy?07/03 03:44
nappinghmm07/03 03:45
nappingthat's a good idea07/03 03:45
nappingI hope March 5 is tomorrow07/03 03:45
copumpkinnapping: yestermorrow07/03 03:46
nappinghttp://trac.haskell.org/haskell-platform/wiki/ReleaseTimetable07/03 03:46
nappingso, about that All example on the mailing list07/03 03:47
Saizanthe one in AutoProof.agda?07/03 03:48
nappingyou can make a function of type like {A} -> (r : Maybe A) -> case r of just _ -> A | nothing -> True07/03 03:48
nappingto use a test as evidence07/03 03:49
copumpkinhm07/03 03:50
Saizantrue07/03 03:50
nappingThat part isn't hard, I was just disappointed how poorly _ inference worked07/03 03:50
Saizanyou'd expect it to figure out that proof too?07/03 03:51
nappingif you have check : A{A P} -> ((a:A) -> P a) -> (L:[Bin]) -> Maybe (All P L)07/03 03:51
nappingI'd expect it to fill out the _ in wasJust (check <checker> _) given a type annotation showing the list07/03 03:52
Saizani guess it can't infer the A in wasJust should be All P L until it computes (check ...) which needs the list07/03 03:54
nappinger, the first explicit argument to check should have result type Maybe (P a)07/03 03:54
xplatit seems like any functor F on a monad category would have an associated monad F(Identity)07/03 06:46
xplatbut the weak coproduct condition doesn't seem like it would be universally true ...07/03 06:47
xplatcopumpkin: istm that a setoid is just a groupoid, or maybe a groupoid that's also a poset.  and ≈ means 'is iso'.07/03 12:09
dolioxplat: Yes. And I was fiddling last night and proved that any monad is a weak coproduct of itself and identity.07/03 15:47
dolioOr, any monad on Agda's Set. I didn't feel like building up all the machinery for the general proof.07/03 15:50
copumpkinuse mine! :P07/03 15:52
dolioEven then I suspect it would be less work.07/03 15:57
dolioSince for natural transformations I get to use 'forall {A} -> ...'.07/03 15:58
dolioAnd rely on Agda normalizing things for the proofs.07/03 15:58
starcloudedhello everybody07/03 16:30
starcloudedhello eveybody07/03 19:20
starcloudedit is posible to construct in agda a dense linear order?07/03 19:20
danrMaybe you want to look at this work: http://web.student.chalmers.se/~stevan/csallp/html/README.html07/03 19:27
danrMaybe the module called DLO is what you search for07/03 19:28
starcloudedthanks07/03 19:33
starcloudedhello everybody07/03 23:17
starcloudedanyone could help with the construction of this ∀a(φ → ψ) → (∀aφ → ∀aψ)07/03 23:20
Saizanthere φ and ψ are supposed to be formulas with a free variable 'a', in Agda you'd represent them with functions07/03 23:26
starcloudedthis is the introduction rule?? Γ ⊢ ∀a(φ → ψ) --------------- Γ ⊢ ∀aφ → ∀aψ07/03 23:35
starcloudedSaizan: so (φ → ψ) is a functions?07/03 23:47
--- Day changed Tue Mar 08 2011
starcloudedhi si there a problem with this construction? hw1 : {A φ ψ : Set}(φ : A → Set)(ψ : A → Set) → ((x : A) → (φ a → ψ a)) → (((x : A) → φ a) → ((x : A) → ψ a))08/03 01:45
dolioYou're using phi and psi twice. Not that that will cause problems.08/03 01:46
dolioThe latter phi and psi are what get used subsequently.08/03 01:46
starcloudedhello08/03 02:15
starcloudedehello everybody08/03 04:06
nappingare inequality proofs unique?08/03 14:02
napping≡-uniq a .a refl refl = refl -- shows that identity proofs are unique08/03 14:02
nappingI'm really trying to figure out some way to take a ≡ b and resolve x ≟ y that's shorter that with on x ≟ y and refuting one of the cases08/03 14:04
nappingactually, it's the a ≢ b case which is tricky08/03 14:05
npouillardfor sure you can define it as a function and use it (∀ {x y} → x ≟ y → x ≡ y → x ≢ y)08/03 14:08
npouillardoops sorry08/03 14:09
npouillardnapping: can you be a bit more precise08/03 14:09
nappingI'm trying to prove things about a function using ≟08/03 14:10
nappingIf I already know that x ≡ y in some case, I can define08/03 14:10
napping≟refl : (x : ℕ) → (x ≟ x) ≡ yes refl08/03 14:11
nappingand the rewriting by it makes the application I am reasoning about progress08/03 14:11
nappingI don't know how to do something similar if I have an inequality proof08/03 14:11
npouillardnapping: you will have problem at proving equalities of negations (since they are function)08/03 14:18
nappingyes, I see.08/03 14:18
nappingIt's a bit awkward, but I can sort of use08/03 14:18
npouillardnapping: what about proving that ≟ returns 'no' without checking the proof08/03 14:18
nappingdata Dec≢ {a b : ℕ} : (Dec (a ≡ b)) → Set where Dec≢no : (P : a ≢ b) → Dec≢ (no P)08/03 14:19
nappingand then prove ≟diff : {x y : ℕ} (H : x ≢ y) (pf : Dec (x ≡ y)) → Dec≢ pf08/03 14:19
nappingthen I can use ≟diff  in a with-clause and match on the result08/03 14:20
nappingbut, it seems I need to also name the thing being decomposed at the same time08/03 14:22
nappingso, with y ≟ x | ≟diff diff (y ≟ x)08/03 14:22
npouillardnapping: what about08/03 14:25
npouillard≟irrefl : (x y : ℕ) → x ≢ y → ∃ λ pf → (x ≟ y) ≡ no pf08/03 14:25
npouillard≟irrefl x y x≢y with x ≟ y08/03 14:25
npouillard... | yes x≡y  = ⊥-elim (x≢y x≡y)08/03 14:25
npouillard... | no  x≢y′ = x≢y′ , refl08/03 14:25
npouillardhum I should have called it ≟no instead08/03 14:26
nappingwhere is ⊥-elim defined?08/03 14:29
nappingah, Data.Empty08/03 14:29
nappingvery odd08/03 14:31
nappingI try to make {x y : ℕ}  implicit, and it decides in the cases that x≡y : 0 ≡ 108/03 14:32
nappingoh, I have another x and y in scope which are 0 and 108/03 14:32
nappingthe sum works, it still seems necessary to name y ≟ x to get progress08/03 14:35
nappingthe goal was (lookup (Γ , y ∷ s) x | y ≟ x) ≡ just t08/03 14:35
npouillardyes this kind of proof about a function using "with" can be very tedious08/03 14:41
npouillardhad to resort defining an induction principle for the function because I could not find how to make it progress in the case of my proof08/03 14:41
nappingthis proof ended up nice enough08/03 14:42
nappingtoo bad I couldn't find anything that would work with rewrite08/03 14:42
nappingbut at least this cleans up some of the bad cases08/03 14:42
nappingall values in a type x ≢ y are of course extensinally equivalent08/03 14:43
nappingand then to the nice ≟no-ext : {x y : ℕ} → (P : x ≢ y) → (x ≟ y) ≡ no P08/03 14:49
npouillardyep08/03 14:50
nappingIs it bad to pattern match on an implicit argument?08/03 14:54
npouillardnop08/03 14:55
nappingOk. I'm proving things about typechecking like emrev : ∀ {Γ x t} → lookup Γ x ≡ just t → Γ ▹v x ∷ t08/03 14:55
npouillardnot always convenient but implicit argument are not tied to somekind of irrelevance08/03 14:56
nappingwhich takes pattern matching on the environment to make progress08/03 14:56
npouillardno problem08/03 14:56
nappingwhy can't I case on variables inside a goal on a line with rewrites?08/03 16:00
nappingI have a line like fun a b c x≡y | inj₁ eq rewrite eq = ?08/03 16:04
nappingwhere x≡y is an equality involving some function applications, and rewriting by eq leaves it obviously absurd08/03 16:05
danrcan't you just pattern-match on eq?08/03 16:17
nappingno, eq is on something uses as a side condition08/03 16:17
nappingit's like (f (suc n) | f n) == true08/03 16:17
nappingthat the type of x≡y, and eq has a type like f n ≡ false08/03 16:17
nappingrewriting by it does make (f (suc n) | f n) reduce to false, but just pattern matching on eq does not08/03 16:18
nappingI would like to write fun a b c () | inj₁ eq rewrite eq08/03 16:18
nappingfor refuting, it works if I use rewrite eq with H ; ... | ()08/03 16:28
nappingwhere H is just repeating the earlier proof that becomes absurd08/03 16:28
starcloudedhello everybody08/03 18:54
starcloudedhello08/03 21:41
starcloudedhw2 : {A : Set}{φ ψ : A → Set} →08/03 21:41
starclouded      ((x : A) → (φ x → ψ x)) →08/03 21:41
starclouded      ((∃ A φ) → (∃ A ψ))08/03 21:41
starcloudedhw2 h d = (b , (h b)) (b , (d b))08/03 21:41
starcloudedwhen I try to load this program it shows me and error08/03 21:41
dolioI'm not surprised.08/03 21:42
starcloudedwhy?08/03 21:42
dolioWell, for one, you have a pair applied to a pair on the right side.08/03 21:42
starcloudedyes I am trying to do this formula ∀a(φ(a) → ψ(a)) → (∃aφ(a) → ∃aψ(a))08/03 21:43
dolioYes.08/03 21:44
dolioBut you have 'f x' where f is a pair.08/03 21:44
dolioPairs aren't functions.08/03 21:44
dolioGenerally.08/03 21:44
dolioI don't know what 'b' is, either.08/03 21:45
starcloudedpostulate08/03 21:45
starclouded  b : A08/03 21:45
dolioWell, that's also kind of odd.08/03 21:46
dolioYou shouldn't need to postulate an inhabitant of A to prove this theorem.08/03 21:47
starcloudedbut how I can relate the b of the universal quantifier to the b of the existential quantifier?08/03 21:52
dolioWhat does an inhabitant of '∃ A φ' look like?08/03 21:54
starcloudedis this?08/03 21:55
starcloudeddata ∃ (A : Set)(B : A → Set) : Set where08/03 21:55
starclouded  _,_ : (witness : A) → B witness → ∃ A B08/03 21:55
dolioYes. So they look like (x , y), right?08/03 21:56
dolioNow, in your theorem, d has type ∃ A φ.08/03 21:57
dolioBut you're applying it to b as if it were a function.08/03 21:57
starcloudedI did that cause I have another the definition that work using that08/03 22:00
starclouded  ∀→∃ : ((x : A) → B x) → ∃ A B08/03 22:00
starclouded  ∀→∃ f = someA , (f someA)08/03 22:00
dolioThe argument to that is a function.08/03 22:01
starcloudedso what it should be the argument?08/03 22:06
dolioThe first argument of hw2 is a function. The second is a pair.08/03 22:08
dolioNow, in ∀→∃, you need to postulate an A, because that proposition is false if A is empty.08/03 22:09
dolioAlthough, postulating an A is kind of bad form.08/03 22:09
dolioYou should take the fact that A is non-empty as an additional hypothesis or something.08/03 22:09
starcloudedbut how can I refer to φ ψ in the right hand side?08/03 22:12
dolioIf you want to do that, you can bind the implicit arguments.08/03 22:12
doliohw2 {A} {phi} {psi} h p = ...08/03 22:13
dolioBut, you shouldn't have to.08/03 22:13
danrAm I just stupid, or what is wrong here?08/03 22:21
danrℓ != ℓ of type Level08/03 22:21
danrwhen checking that the expression ⟦ lhs ⟧ Γ ≈ ⟦ rhs ⟧ Γ has type08/03 22:21
danrSet ℓ08/03 22:21
danroh08/03 22:22
danrI had two different \ell in scope08/03 22:22
danrsorry08/03 22:22
dolioHah! That was my guess.08/03 22:22
danr:)08/03 22:22
starcloudeddolio: i dont know how to make the definition for that construction of hw208/03 22:23
dolioHave you learned about pattern matching yet?08/03 22:23
starcloudedC-c C-c in emacs?08/03 22:25
dolioThat'll expand something for you, yes.08/03 22:26
dolioYou can type it in manually.08/03 22:26
dolioSorry, I've got an errand to run. I'll be back later.08/03 22:28
starcloudedok thanks08/03 22:28
--- Day changed Wed Mar 09 2011
starcloudedhello everybody is posible to prove this in agda ∀a(φ(a) ∨ ¬φ(a)) ∧ ¬¬∀aφ(a) → ∀aφ(a)?09/03 01:06
nappingagda has let and where?!09/03 01:56
nappinghow did I miss that?09/03 01:56
starcloudedhello is there a way hw3 : {A : Set}{φ ψ : A → Set}(P : φ → ψ → Set) →       ∃ A P → ((x : A) → φ x) → ∃ A ψ09/03 02:26
starcloudedI am trying to implement this formula ∃a(φ(a) → ψ(a)) ∧ ∀aφ(a) → ∃aψ(a)09/03 02:27
starcloudedbut when I make the construction like this hw3 : {A : Set}{φ ψ : A → Set}(P : φ → ψ → Set) →       ∃ A P → ((x : A) → φ x) → ∃ A ψ  it throws me and error09/03 02:28
starcloudedany ideas?09/03 02:29
Saizani don't see why you have the P argument there09/03 02:29
Saizanalso, φ → ψ → Set is not well typed09/03 02:29
starcloudedcause when I try to do simething like this hw3 : {A : Set}{φ ψ : A → Set} →       ∃ A (φ → ψ) → ((x : A) → φ x) → ∃ A ψ  it throws me an error too09/03 02:31
Saizanthe second argument to ∃ is a function A -> Set09/03 02:31
Saizanso it should look like (\ a -> ..) where you've to replace .. with something of type Set09/03 02:32
starcloudedthat's way a create P09/03 02:33
starcloudedthat's why I create P, sorry09/03 02:33
Saizani don't see how a P argument would help09/03 02:33
starcloudedcause the definition of ∃ is like this data ∃ (A : Set)(B : A → Set) : Set where   _,_ : (witness : A) → B witness → ∃ A B09/03 02:34
starcloudedor it doesn't matter?09/03 02:34
Saizanit does matte, that's why i've said the second argument has to be of type A -> Set09/03 02:35
Saizanare you familiar with lambda expressions?09/03 02:35
starcloudedno09/03 02:35
Saizanok, so you might define a "P : (A : Set) (φ ψ : A → Set) -> A -> Set" separately09/03 02:36
Saizanand then use ∃ A (P A φ ψ)09/03 02:37
starcloudedso it should be something like this hw3 : P : (A : Set)(φ ψ : A → Set) -> A -> Set →       ∃ A (P A φ ψ) → ((x : A) → φ x) → ∃ A ψ09/03 02:41
starcloudedbut it throws me an error09/03 02:42
starcloudedbut doesn't say much09/03 02:42
nappingthat doesn't look right at all09/03 02:42
nappingtwo : in a line is a problem09/03 02:42
nappingI think the suggestion was to define P as a separate function09/03 02:43
nappingoh, also each ∃ needs to be applied to a function09/03 02:43
nappingare you sure e.g. A ψ is a function?09/03 02:43
Saizanyeah, i mean P as a separate definition09/03 02:46
starcloudedok ok09/03 02:47
nappingis there a local form of "open"?09/03 02:51
Saizanyou can open in a where09/03 02:52
nappingis that documented?09/03 02:52
Saizannot sure, it's used in the stdlib though, i think09/03 02:53
nappinglots of nice syntax today09/03 02:53
nappingis there any way to write ... | abbreviation, and still mention things before the newly with-ed stuff?09/03 02:54
Saizanyes, if you bound it on the line of the with09/03 02:57
Saizanfoo : ℕ -> ℕ09/03 02:57
Saizanfoo a with 109/03 02:57
Saizan... | x = a09/03 02:57
nappingI mean like09/03 03:01
nappingfoo a with x ≟ y09/03 03:01
napping... () | yes refl09/03 03:01
Saizanah, then no, afaik09/03 03:01
nappingsome things I approximate by including the thing to be refuted in the with09/03 03:02
nappinghey, I should post some examples to the list09/03 03:02
nappingit seems if the rewrite clause makes something absurd, you can't refute it on that lin09/03 03:02
nappingopen also seems to work as a let binding09/03 03:03
Saizanwell, i usually just let C-c C-c rewrite the dots into the actual patterns when i case split on the with09/03 03:03
nappingI have some proofs that got rather long if I left all the arguments visible09/03 03:04
nappingI can't define fun : (b : Bool) → So b → b ≡ false → ⊥09/03 03:13
nappingby fun b () eq rewrite eq09/03 03:13
Saizanyeah, for the same reason you can't define it like fun b () eq with eq; ... | refl09/03 03:17
starcloudedhello again09/03 03:26
napping C-c C-, doesn't show the binding from quoteGoal09/03 03:39
starcloudedhello again09/03 03:40
napping_≟-Name_ is made of lies09/03 03:41
napping... | true  = yes trustMe09/03 03:41
napping... | false = no whatever09/03 03:41
napping  where postulate whatever : _09/03 03:41
Saizanheh09/03 03:43
nappingis there a nice way to write a bunch of boolean tests?09/03 03:46
nappingI think the withs will pile up, if the unquoter tests the "def" against all the names it knows09/03 03:46
nappingmy first reflective solver09/03 03:50
nappingwell, at least in agda. http://hpaste.org/44633/reflection09/03 03:50
nappinglooks pretty ugly09/03 03:50
Saizancould be better with data U : Set where bool top : U; [_] : U -> Set; unQuote : Term -> U; solver : (t : Term) -> [ unQuote t ]; then you just have to pattern match on unQuote t in solver09/03 03:55
Saizanor even define solver' : (u : U) -> [ u ] and solver = solver' \o unQuote09/03 03:57
nappingah, that's much better than expanding all the cases just to match the _ in unQuote09/03 04:00
Saizanyeah, that's very annoying09/03 04:02
nappingIs there a good way to select from many different names?09/03 04:05
Saizanyou could use an association list and a lookup function, maybe09/03 04:07
nappingI think that would only work if all symbols have the same type09/03 04:08
starcloudedhow is the use of existential quantifier using the standard library?09/03 04:32
nappingWhat?09/03 04:35
starcloudedi'm getting an error trying to load this formula hw2 : {A : Set}{φ ψ : A → Set} →09/03 04:36
starclouded      ((x : A) → (φ x → ψ x)) →09/03 04:36
starclouded      ((∃ A ⊎ φ) → (∃ A ψ))09/03 04:36
starcloudedhw2 f (x , p) = x , f x p09/03 04:36
nappingin the type?09/03 04:37
nappingor the definition?09/03 04:37
starcloudedin the type09/03 04:37
starcloudedthis error Set !=< (_35 → Set _34) of type Set₁09/03 04:37
starcloudedwhen checking that the expression A has type (_35 → Set _34)09/03 04:37
nappingoh, the exists is wrong09/03 04:37
nappinglook it up09/03 04:37
napping(middle click, or M-.)09/03 04:37
starcloudedwhy is it wrong?09/03 04:39
napping : ∀ {a b} {A : Set a} → (A → Set b) → Set (a ⊔ b)09/03 04:40
nappingA is not a function09/03 04:40
napping∃ A means "exists an x, such that A x"09/03 04:41
nappingand A is not a function09/03 04:41
nappingmaybe you are trying to explicitly declare the argument type?09/03 04:41
nappingΣ takes an argument type09/03 04:42
napping∃ = Σ _09/03 04:42
nappingthe application ∃ ψ  makes sense09/03 04:42
nappingor Σ A ψ, to be explicit that the argument has type A09/03 04:42
napping∃ A ⊎ φ isn't close to anything ensensible09/03 04:42
starcloudedok napping thank you09/03 04:44
starcloudedgood bye everybody09/03 05:24
kosmikushi wouters09/03 08:54
woutershiya09/03 08:54
kosmikuswouters: going to AIM?09/03 08:54
woutersNo, I'm afraid not.09/03 08:54
kosmikustoo bad09/03 08:54
kosmikus:)09/03 08:54
woutersI want to avoid traveling too much, until things have settled down a bit with our son.09/03 08:55
woutersI'm quite hopeful I'll be going to Iceland though.09/03 08:55
kosmikusright09/03 08:55
starcloudedhello everydoby09/03 17:37
starcloudedhow can I do this -- ∃a(φ(a) → ψ(a)) ∧ ∀aφ(a) → ∃aψ(a) using lamba expressions?09/03 17:47
starcloudedin this moment I have this P : (A : Set)(φ ψ : A → Set) → A → Set09/03 17:47
starcloudedP a φ ψ = ψ09/03 17:47
starcloudedhw3 : {A : Set}{φ ψ : A → Set} → ∃ A  ∧ ((x : A) → φ x) → ∃ A ψ09/03 17:47
starcloudedhw3 ((a , p) , ψ) = a , p09/03 17:47
starcloudedbut I need to do it using lamba expression09/03 17:48
starcloudedany ideas?09/03 17:48
--- Day changed Thu Mar 10 2011
xplati can usually tell what people are talking aobut when they answer starclouded's questions10/03 00:43
xplatwhen napping asks something, i have no idea what the question or the answer means :(10/03 00:44
xplati think i keep trying to think of agda alternately as logic and as ‘slightly fancier haskell’ and neither viewpoint is appropriate for those issues10/03 00:45
Saizanthe quote* stuff is fairly new and not widely used yet10/03 00:46
dolioYeah, I haven't even bothered diving into that yet.10/03 00:48
xplatwell, the rewriting bits confuse me too10/03 02:56
copumpkin?10/03 02:59
xplat22:04 < napping> it seems if the rewrite clause makes something absurd, you can't refute it on that lin10/03 03:43
xplatstuff like ‘ | eq rewrite eq’10/03 03:44
xplatalso, one of the great things about really flexible syntax is that you can't tell library functions from builtin special forms10/03 03:45
xplatand one of the horrible things about really flexible syntax is that you can't tell library functions from builtin special forms10/03 03:45
xplatperhaps there's a need for an 'aggle' or something that will understand things like _|_ (not to be confused with bottom) and will point you at documentation even if it is a special form10/03 03:48
xplatalthough i guess most of the info in this case is under _rewrite_ which is more googleable10/03 03:50
xplati guess i have a pretty weak idea of how all the lhs/with stuff works in agda generally, which is what i was talking about wrt conceptual gaps10/03 03:55
Saizanxplat: inside agda mode the distinction is quite clearer, both because of colors and because M-. (jump to definition) doesn't work for syntax10/03 08:23
xplatSaizan: ah, true10/03 12:34
starcloudedhello everybody10/03 16:48
--- Day changed Fri Mar 11 2011
djahandariekfish, you guys alright over there?11/03 06:23
kfishhi, yeah11/03 06:25
kfishwe were under the desks for a bit twice :)11/03 06:25
djahandarieI hear it's still going on11/03 06:25
djahandarieI'm getting some pics near the coast where things are getting entirely destroyed... scary.11/03 06:26
kfishyeah, still some random wobbling and we can see some fire by the bay11/03 06:26
djahandarieI think fuji tv caught on fire11/03 06:26
kfishliyang may have some photos11/03 06:26
djahandarieI just got my friend to turn on a video stream for me11/03 06:27
djahandarieOh wow, it's shaky quite hard even in the studio11/03 06:27
liyangFantastic quake. Best ever!11/03 07:30
djahandarieliyang, you have strange tastes...11/03 07:32
* djahandarie は寝込みます、おやすみ。きをつけてね11/03 07:36
greapHey all. I'm installing agda with cabal-dev to avoid the mess that inevitably occurs when my cabal dependencies get messed up. I'm getting quickcheck dependency errors now. Has anyone had experience installing agda this way?11/03 13:11
Saizangreap: which version of ghc are you using?11/03 13:46
SnufsenHej danr11/03 15:24
nappingIs there some way to use modules as sections to abbreviate common parameters on record fields?11/03 22:41
nappingit seems definitions interspersed with fields turn into let bindings11/03 22:44
nappingand let bindings do not like modules11/03 22:44
Saizanyou'd like to open a11/03 22:45
Saizana module inside a record definition?11/03 22:45
nappingopening works fine11/03 22:52
nappingI have a record that includes an operation, and is also supposed to include various properties11/03 22:52
napping    ⟨_,_⟩ : ∀{A B C} → (A ↝ B) → (A ↝ C) → A ↝ (B × C)11/03 22:53
napping    ⟨_,_⟩₁ : ∀{A B C}(f : A ↝ B)(g : A ↝ C) → ⟨ f , g ⟩ ⟫ π₁ ≈H f11/03 22:53
napping    ⟨_,_⟩₂ : ∀{A B C}(f : A ↝ B)(g : A ↝ C) → ⟨ f , g ⟩ ⟫ π₂ ≈H g11/03 22:53
nappingetc11/03 22:53
copumpkin:O11/03 22:53
nappingIf I wasn't working in a record, I might define the pairing, and then define a module parameterized over A B C f g and prove the lemmas inside11/03 22:55
nappingthen open it to get the parameterized version11/03 22:55
nappingI don't see any obvious way to give a record a common prefix11/03 22:56
nappingrecord fields, rather11/03 22:56
nappingcopumpkin: you defined some category theory stuff, didn't you?11/03 22:56
nappingis there any way to make records agree on things without parameterizing them?11/03 22:57
copumpkinhow do you mean? my stuff is up here: https://github.com/pumpkin/categories11/03 22:57
nappingnow I have a basic unparameterized record Category : Set₁11/03 22:57
copumpkinagree according to propositional equality?11/03 22:57
nappingthen describe terminal objects with record Terminal (cat : Category) : Set where11/03 22:57
nappingand also record Exponentials (cat : Category ; prod : Products cat) : Set where11/03 22:57
nappingand finally carteisian closed categories11/03 22:58
nappingrecord CCC (cat : Category ; prod : Products cat ; exp : Exponentials cat prod) : Set where11/03 22:58
nappingso, you just have a field giving the category operations, and use propositional equality to force things to be the same in CCC?11/03 22:58
copumpkinI don't use propositional equality anywhere11/03 22:58
copumpkinnot explicitly, anyway11/03 22:59
copumpkinbut that was one of the main reasons I wrote the library11/03 22:59
copumpkinwhat do you want to be the same?11/03 22:59
nappingI'm defining a category with products as a category plus other stuff11/03 22:59
nappingand a category with a terminal object as a category with other stuff11/03 22:59
copumpkinhmm11/03 23:00
copumpkinthat seems odd11/03 23:00
nappingthen how do I define a category with products and a terminal object?11/03 23:00
copumpkinI wouldn't do it that way11/03 23:00
nappinghow would you do it?11/03 23:00
nappingyou need to have composition and a type for morphisms and such to even start stating some of the definitions11/03 23:01
Saizanso, instead of making Terminal take a cat argument it'd have a cat field, right? then i don't see any other way than using an additional equality to express sharing11/03 23:06
Saizannot sure how easy it is to work that way11/03 23:06
nappingYeah, I've parameterized it for now11/03 23:07
nappingIt's easy enough to open the parameter, but they seem to be piling up on more derived definitions11/03 23:07
nappingAnd I already had to switch to Category having the type of objects and morphisms as fields instead of parameters, because there were too many11/03 23:08
napping(counting the equalities as well)11/03 23:08
nappingI'm having trouble formulating definitions then11/03 23:18
nappingTerminal.cat term != Products.cat (Exponentials.prod exp)11/03 23:19
Saizancan you show the code?11/03 23:22
napping http://hpaste.org/44709/record_sharing11/03 23:23
nappingthat's a version I tried to convert to just working in terms of members11/03 23:23
nappingML has sharing annotations11/03 23:24
Saizanyeah11/03 23:24
Saizanhere you'd need to manually subst with the catSame11/03 23:25
nappingIt's not obvious how to do that in the type signature11/03 23:25
nappinghmm, rewrite doesn11/03 23:27
Saizan"cong Category.O catSame" is a proof that the two object types are the same, then you should be able to cast _^_ to accept term's objects11/03 23:29
Saizanmaybe it's easier to write castExp : (C D : Category) -> (C == D) -> (e : Exponentials) -> cat e == C -> Exponentials11/03 23:32
Saizanand then open Exponentials (castExp ...)11/03 23:32
nappingI seem to have timed out11/03 23:37
nappingis agda equipped with logs?11/03 23:37
nappingah, here we are11/03 23:37
nappingnope, not quite up to date11/03 23:38
Saizan00:29     Saizan : "cong Category.O catSame" is a proof that the two object types are the same, then you should be able to cast _^_ to accept term's  objects11/03 23:38
Saizan00:32     Saizan : maybe it's easier to write castExp : (C D : Category) -> (C == D) -> (e : Exponentials) -> cat e == C -> Exponentials11/03 23:38
Saizan00:32     Saizan : and then open Exponentials (castExp ...)11/03 23:38
Saizanthough not so helpful, i'm afraid11/03 23:38
nappingyeah, I think the stuff I tried with naming things makes it unlikely to work out11/03 23:39
--- Day changed Sat Mar 12 2011
liyangdjahandarie: this is one of the safest towers in Tokyo. May as well enjoy it!12/03 07:03
--- Log opened Sat Mar 12 21:02:01 2011
-!- Irssi: #agda: Total of 35 nicks [0 ops, 0 halfops, 0 voices, 35 normal]12/03 21:02
Saizancool, A and Α are distinct identifiers12/03 21:02
-!- Irssi: Join to #agda was synced in 63 secs12/03 21:02
djahandarieYou can add x amount of unicode zero-width spaces and have an unlimited amount of look-alike identifiers12/03 21:17
sullygreat.12/03 21:33
--- Day changed Sun Mar 13 2011
dolioAwesome.13/03 00:41
djahandarieΑwesome.13/03 00:43
dolioAre zero-width spaces not in the Space general category?13/03 00:43
dolioOr does Agda just not check?13/03 00:44
djahandarieActually, I haven't tried and should confirm this, I was assuming that it didn't check.13/03 00:44
dolioI'm not sure what Saizan's example is. Is one of those a non-Latin character that looks exactly like A?13/03 00:47
djahandarieYeah.13/03 00:47
djahandarieAnd unfortunately, my Agda install seems to be completely bricked right now so I can't. :P13/03 00:47
dolioHow do I type a zero-width space? I can check.13/03 00:48
Saizandolio: one is a capital alpha13/03 00:48
dolioOh.13/03 00:48
djahandariedolio, it's codepoint 8203 (decimal)13/03 00:49
dolioHmm...13/03 00:49
doliozero-width space seems to be a lexical error.13/03 00:55
dolioThat's probably the best way to handle it.13/03 00:56
acowleyIs there any way to get something in the spirit of this going?13/03 05:53
acowleydata FStream (F : Set -> Set) (A : Set) : Set where13/03 05:53
acowley  T : F (A × ∞ (FStream F A)) -> FStream F A13/03 05:53
acowley 13/03 05:53
acowley 13/03 05:53
dolioNot with F : Set -> Set.13/03 05:54
dolioYou can write a type of codes for strictly-positive functors, though.13/03 05:54
acowleyWhat should F be? I have some Haskell code where F is a functor13/03 05:54
acowleyand I wanted to prove something about this other type, but I'm running aground13/03 05:54
dolioSo, 'data Functor : Set1 where ...'13/03 05:55
dolioInterp : Functor -> (Set -> Set)13/03 05:56
doliodata FStream (F : Functor) ... where T : Interp F (A x inf (FStream F A) ...13/03 05:56
acowleyOh13/03 05:57
dolioIf your Interp function only uses its second argument in a strictly positive way, Agda will hopefully be able to detect it.13/03 05:57
dolioAnd it will thus be able to see that FStream is a strictly positive type.13/03 05:57
acowleybut now I'm not thinking straight13/03 05:57
acowleywhat constructors does Functor have?13/03 05:57
dolioFor that, I direct you to Epigram related work by Conor McBride and others.13/03 05:58
acowleyOkay. I looked at RawFunctor record in the stdlib, but I have to admit it never occurred to me to try to write a data type13/03 05:59
dolioBut, it's something like...13/03 05:59
dolioThe constant functor K A is strictly positive.13/03 06:00
dolioThe identity functor is strictly positive.13/03 06:00
dolioThe product and sum of two strictly positive functor is strictly positive.13/03 06:00
dolioAnd \X -> A -> F X is strictly positive if F is striclty positive.13/03 06:01
dolioSome of that is technically redundant.13/03 06:02
dolioAnd if you want dependent types involved, there's more.13/03 06:02
dolio\X -> (a : A) -> F a X should be strictly positive is F a is strictly positive for all a.13/03 06:03
dolioI think The Gentle Art of Levitation gives a minimal set of descriptors for that kind of thing.13/03 06:04
dolioBut I don't know your background. It could be a little scary.13/03 06:04
acowleyWell I don't think I need dependent types13/03 06:04
acowleyAll I had set out to do was prove that FStream is a functor13/03 06:05
acowleybut I run into a case where I need coinduction13/03 06:05
acowleyand I have no faith in my understanding of such matters, so wanted to try things out in Agda or Coq, but quickly ran into not strictly positive types13/03 06:06
dolioYeah.13/03 06:06
dolioIf you want to fiddle around with miniAgda, by Andreas Abel, it has the ability to annotate things with their positivity.13/03 06:06
dolioSo you can write: 'data FStream (F : ++Set -> Set) (A : Set) : Set where ...'13/03 06:07
dolio++ meaning strictly positive.13/03 06:07
acowleythat would be handy13/03 06:07
dolioYeah.13/03 06:07
dolioI don't know if it's easy to get running or not.13/03 06:08
dolioIt's got somewhat different syntax, too, though. And less tool support, I expect.13/03 06:08
acowleyUpon quick inspection (though the paper's reputation suggests that "quick inspection" is woefully inadequate) the levitation paper is a lot more involved than what I was hoping for :)13/03 06:09
dolioYeah.13/03 06:10
acowleyI really am just not sure when I can safely apply a coinduction hypothesis13/03 06:10
acowleyThe equations look like a bisimulation13/03 06:10
acowleybut there's a recursion lurking in there13/03 06:10
dolioOh.13/03 06:11
acowleyand I just want to be honest about it13/03 06:11
dolioWell, you should be able to make a corecursive call as long as it's guarded by constructors all the way up.13/03 06:11
dolioAnd possibly record projections, I'm not sure at this point.13/03 06:11
dolioNo ordinary functions, though.13/03 06:12
dolioEven if you, personally, can tell that they'd be productive.13/03 06:12
acowleycan you take a quick look at this? m is my inner functor, and fmap f (T t) = T (fmap (f *** fmap f) t)13/03 06:14
acowleyhttp://www.seas.upenn.edu/~acowley/CoProof.pdf13/03 06:14
acowleythat's supposed to be some easy reasoning13/03 06:14
acowleywhere the \otimes is a specialized ***13/03 06:14
acowleywhere I lost my nerve is that T is a newtype, and I'm only 99% sure my recursive call is under the pair constructor13/03 06:16
dolioIt looks fine to me.13/03 06:17
acowleyProof by dolio13/03 06:18
dolio(f1 (x) g1) . (f2 (x) g2) = (f1 . f2) (x) (g1 . g2) is, by the way, the functor composition law for the product bifunctor.13/03 06:19
acowleyso I could just tell my audience that pairs are a bifunctor13/03 06:20
dolioRight.13/03 06:20
acowley(my audience doesn't know types, Haskell, or functional programming)13/03 06:20
dolioJust like m is a functor, and you use that.13/03 06:20
acowley:)13/03 06:20
acowleyThat's a good note13/03 06:20
acowleyI'll put that next to the \otimes lemma13/03 06:21
acowleyor perhaps just use that reference if I'm short on space13/03 06:21
acowleyIt's been pretty frustrating trying to find references on infinite data13/03 06:22
acowleyI think the thing that bugs me is that the recursive call is made under a pair constructor which doesn't itself appear here13/03 06:31
dolioYes, well, you certainly can't write it that way in Agda.13/03 06:33
acowleyeven though the types mean there must be a pair?13/03 06:35
acowleyI guess that's the result of syntactic analysis13/03 06:35
dolioTo be honest, even if you didn't have the pair, it wouldn't work.13/03 06:35
dolioSupposing the type were allowed.13/03 06:35
acowleyWell, I need the pair to guard the corecursion13/03 06:36
dolioBecause f (T t) = T (fmap_m (fmap f) t) isn't proper.13/03 06:37
dolioIt doesn't follow the rules.13/03 06:37
acowleywhich rules? I thought the pair was exactly what is giving me productivity13/03 06:38
dolioThe rule is that you're allowed to write 'f x = <C> (f y)' as long as <C> is a series of constructors.13/03 06:39
dolioSo, 'f x = C1 (C2 (C3 (f y)))' is okay if CN are all constructors.13/03 06:40
dolio'f x = g (C2 (C3 (f y)))' is not, and so on.13/03 06:40
acowleyI did not know that13/03 06:41
dolioIf g is a non-constructor function.13/03 06:41
dolioThat's what 'guarded' means.13/03 06:41
dolioYou can make recursive calls as long as they're inside a series of one or more constructors.13/03 06:42
acowleyOh, you mean for the termination checking13/03 06:42
dolioYes.13/03 06:42
acowleyWould there be a way of writing it such that the pair constructor was more prominent?13/03 06:43
dolioI think your parameterizing by the functor prevents that.13/03 06:43
dolioKeeps you from matching at the top.13/03 06:44
acowleyHm, right13/03 06:44
acowleyHow would one make the argument precise, then?13/03 06:44
dolioIn Agda? I don't know. It might not be feasible to get it accepted.13/03 06:45
acowleyI meant in general13/03 06:46
acowleyWell, I guess it's a bisimilarity relation, but I'm just not comfortable with that style of proof13/03 06:49
dolioIn general, you'd probably use the universality principle for FStream F A.13/03 06:49
dolioIt's the final coalgebra of \X -> F (A x X), which gives you a way to define functions on it.13/03 06:49
acowleyI did take a quick whack at it before, but couldn't figure out how the final coalgebra gave me what I needed. I should read more.13/03 06:51
doliomap_FStream f = unfold (map_F (f (x) id) . out)13/03 06:51
dolioSomething like that.13/03 06:51
acowleyThanks, dolio, you've been a tremendous help13/03 06:55
dolioNo problem.13/03 06:56
starcloudedwhich is in the standard library the equivalence?13/03 19:43
starcloudedsorry hello everybody13/03 19:46
napping"which"?13/03 19:48
nappingRelation.Binary.PropositionalEquality defines a _13/03 19:48
nappinga _\==_ which is probably the most common equality13/03 19:49
nappingthat's the one which is equivalent to definitional equality13/03 19:50
starcloudedany ideas13/03 19:50
nappingI don't understand your question.13/03 19:51
starcloudedin the standard library with Data.Sum I could use de disjunction what is the standard library from the equivalence?13/03 19:57
nappingI13/03 19:58
nappingI'm having trouble with grammar13/03 19:58
nappingCould you rephrase "what is the standard library from the equivalence"13/03 19:59
nappingData.Sum gives you the sum type ⊎13/03 19:59
nappingRelation.Binary.PropositionalEquality provides the equality type ≡ defined by13/03 20:01
nappingdata _≡_ {a} {A : Set a} (x : A) : A → Set a where refl : x ≡ x13/03 20:01
nappingEquality is more confusing, because a lot of code is parameterized over an equivalence relation13/03 20:06
nappingIf it mentions Setoid or _≈_ then it can work with other equivalence relations13/03 20:11
nappingdoes Agda have module interfaces?13/03 20:15
Saizanjust records13/03 20:16
nappingI guess they usually work pretty well13/03 20:16
nappingWhat about equality and inequality defined in terms of a boolean comparison?13/03 20:17
nappingIt's nice that ≡ has only one proof - it would be nice if ≢ did as well13/03 20:17
dolioModules are dependent records as long as you don't expect them to provide any abstraction.13/03 20:17
nappingand it does if you define a ≢ b = (a == b) ≡ false13/03 20:17
nappingof course that only works in the presence of the decidable equality13/03 20:18
* napping considers whether replacing ∀ {Γ x t} → x ∷ t ∈ Γ → (∃ λ pf → lookup Γ x ≡ just (t , pf)) with ∀ {Γ x t} → (pf : x ∷ t ∈ Γ) → lookup Γ x ≡ just (t , pf) is worth building up that infrastructure13/03 20:20
nappingthe only thing that currently prevents typing from having unique proofs is the inequality assertion in my environment lookup predicate13/03 20:22
Saizanin the past i've left ≡ alone and just made up something else for ≢13/03 20:30
--- Log closed Mon Mar 14 18:50:26 2011
--- Log opened Mon Mar 14 18:50:34 2011
-!- Irssi: #agda: Total of 35 nicks [0 ops, 0 halfops, 0 voices, 35 normal]14/03 18:50
!calvino.freenode.net [freenode-info] channel trolls and no channel staff around to help? please check with freenode support: http://freenode.net/faq.shtml#gettinghelp14/03 18:50
-!- Irssi: Join to #agda was synced in 71 secs14/03 18:51
nappingcan irrelevant arguments be implicit?14/03 20:01
copumpkinI don't see why not, but haven't tried it14/03 20:02
dolioYeah, there's no reason they couldn't.14/03 20:03
dolioI wouldn't be surprised if there's no syntactic consideration, though.14/03 20:03
copumpkinunless someone hasn't gotten around to figuring out a syntax for them14/03 20:03
copumpkinlol14/03 20:03
nappingwell .{Ty} fails, as does .{name : Ty}14/03 20:03
dolioWell, the latter isn't supported even for non-implicits.14/03 20:04
dolioHow about {.Ty}?14/03 20:04
nappingno, that gives a message that {...} needs to be an argument of a function14/03 20:05
dolioYou're probably out of luck, then.14/03 20:05
nappingwell, I suppose it's not really necessary to make it irrelevant14/03 20:05
nappingI'm just trying to translate some set theoretic stuff14/03 20:06
dolioYou can use the squash type instead if you're desperate.14/03 20:06
SaizanOTOH, would irrelevant implicits ever be inferred currently?14/03 20:06
nappingIt should be possible, but I don't know if it would actually work14/03 20:09
nappingWith irrelevance, it just needs to dig up something of the appropriate type14/03 20:13
Saizanyeah, but it's not doing that14/03 20:18
--- Day changed Tue Mar 15 2011
nappingIs anyone here familiar with Maude?15/03 00:24
nappingTheir mixfix syntax is interesting15/03 00:25
nappingIt seems to manage without so many spaces, and allows overriding application15/03 00:25
rntzHi. I have found a potential bug. I am using Agda-2.2.6 (according to ghc-pkg) with GHC 01:18
rntzLoading a test file http://sprunge.us/KKMU from within emacs agda2-mode results in the error message http://sprunge.us/cEOB15/03 01:18
pumpkinyou should try the latest agda15/03 01:18
pumpkinbugs get fixed all the time :)15/03 01:18
nappingI see an internal error also in the latest agda15/03 01:18
nappingor at least in 2.2.1015/03 01:19
rntzthis is a good point; however, the test file is really small, so I was going to ask if anyone would try to replicate it15/03 01:19
nappingpros?15/03 01:19
nappingooops. Anyway, seems like you should post it to the list15/03 01:20
pumpkinor just post it to the bugtracker15/03 01:21
pumpkinif it's a minimal testcase15/03 01:21
nappingit is minimal15/03 01:22
nappingapparently the same error is produced if one argumnet is removed and the first line is foo foo with foo15/03 01:22
nappingbut using the same name twice is kind of misleading15/03 01:22
rntzright.15/03 01:22
nappingYou could make the body ?15/03 01:22
rntzwould that be more helpful? I felt like leaving a hole in it might also be misleading.15/03 01:23
rntzanyway, I will submit it to the bugtracker15/03 01:23
rntznapping: what line number is given by the error in Agda 2.2.10?15/03 01:26
rntzas presumably it may have changed15/03 01:26
nappingsrc/full/Agda/Syntax/Translation/ConcreteToAbstract.hs:348315/03 01:27
nappingsrc/full/Agda/Syntax/Translation/ConcreteToAbstract.hs:34815/03 01:27
rntzhttp://code.google.com/p/agda/issues/detail?id=39515/03 01:30
pumpkinnapping: is your CT stuff up somewhere btw?15/03 01:33
nappingnope, it's nowhere near done either15/03 01:34
nappingI'm just trying to do CCCs for a homework on models of lambda calculus15/03 01:34
pumpkinah I see15/03 01:34
nappingI won't finish it until after some other work15/03 01:35
nappingIt might be done in a few more days15/03 01:36
pumpkincool15/03 01:37
Mathnerd314how many LOC is Agda?15/03 01:37
napping5496915/03 01:39
pumpkinit's a pretty hefty project15/03 01:39
Mathnerd314ok15/03 01:39
Mathnerd314what part would you say takes up the most space?15/03 01:40
pumpkinI've noticed that the serialization of the interface files takes ages to compile when I build it15/03 01:40
pumpkinnever really looked though15/03 01:40
napping: takes up the most space when you run it15/03 01:40
nappingdamn String15/03 01:40
pumpkinI got    69193 total15/03 01:42
pumpkinout of curiosity, what's this homework on models of lambda calculus?15/03 01:44
pumpkinand did they actually ask for CCCs?15/03 01:44
nappingcs522 at UIUC15/03 01:44
nappingthe not yet out hw415/03 01:44
pumpkinoh, you TAing it?15/03 01:44
nappingno, taking it15/03 01:44
pumpkin:o15/03 01:45
nappingbut the slides have some exercise in them which it is said may eventually be assigned15/03 01:45
nappingWe've certainly defined CCCs and models of the lambda calculus in class15/03 01:45
pumpkinI see15/03 01:45
nappingand I already formalized some results on typing the STLC15/03 01:45
pumpkincool15/03 01:46
pumpkinit'd be nice to get an agda hackage + cabal up and running sometime15/03 01:52
pumpkinthere's lot of code sitting around in all our repositories that nobody ever uses15/03 01:52
pumpkinnot that there's anyone actually using agda anyway, but having a central place to keep track of what's been done could still be of benefit :)15/03 01:53
nappingI don't think I've ever run an Agda program15/03 01:53
pumpkinstill, just reading other people's code and having highlighted version of it lying around15/03 01:53
pumpkinto see what people have proved and how15/03 01:53
pumpkinor even to build upon those proofs15/03 01:53
pumpkindolio's zigzag thing seems generally useful, for example15/03 01:53
pumpkinespecially for proofs about languages15/03 01:53
Mathnerd314once you get a lot of proofs together, you can start writing meta-proofs!15/03 01:54
pumpkinhttp://code.haskell.org/~dolio/agda-share/ZigZag.agda is what I was talking about btw15/03 01:56
nappinglooks a bit out of date15/03 01:59
pumpkinit's from a while ago, but would be easy to bring up to date15/03 01:59
nappingwhat does it do?15/03 01:59
pumpkinyou know control-monad-omega?15/03 02:00
nappingno15/03 02:00
pumpkinit basically gives you diagonal traversal of a possibly infinite list of possibly infinite lists [[a]] -> [a]15/03 02:00
pumpkinzig-zag : ∀{A} → Colist (Colist⁺ A) → Colist A15/03 02:00
pumpkinthat's that15/03 02:00
pumpkinthen proves that every element in all lists occurs at a finite index of the output15/03 02:01
Mathnerd314but is it actually a monad?15/03 02:01
pumpkinwell, this one doesn't even pretend to be15/03 02:01
pumpkinbut with an Eq instance/setoid that ignored order and duplication it could probably be15/03 02:02
pumpkinColist+ is a non-empty colist15/03 02:02
nappinghmm, it really doesn't like switching to the library Σ, ⊎, and ×15/03 02:02
pumpkinthe only thing I'd really do is replace the sharp and flat in there15/03 02:03
nappingalso turn on --universe-polymorphism and open import Level15/03 02:03
nappingthat got it to typecheck15/03 02:03
nappingSomething like Cabal might be fun15/03 02:05
nappingfinally a language where the package versioning policy might mean something15/03 02:06
Mathnerd314but if you write perfect proof-checked programs, there's not much reason to have a versioning scheme15/03 02:08
Mathnerd314after all, none of the updates will change behavior15/03 02:10
nappingno, you could change behavior15/03 02:10
nappingyou could also provide more properterties15/03 02:11
nappingbut you know that any behavior a client could be proved to have it will still have, if you export all the same functions and same lemmas about them15/03 02:11
Mathnerd314whatever15/03 02:12
Mathnerd314dcvs seems to be standardizing as "the" solution anyways15/03 02:12
nappingwhat does that have to do with verified programs?15/03 02:17
copumpkinI've kind of wanted a source control program that's aware of the language's semantics for the sake of determining what code chunks are dependent on one another15/03 02:20
copumpkinwith agda, that awareness could be down to the actual runtime behavior15/03 02:20
copumpkinof course, I'm not sure who would want to deal with that15/03 02:20
copumpkinhaving a VCS that is also aware of your language's syntax could also make smarter decisions about code changes that are formatting-only and others that preserve types and interfaces and so on15/03 02:21
shachafAny hand-wavey intuition going on in here?15/03 06:03
copumpkinoh no15/03 06:03
copumpkinthis is the land of bound hands and frustration15/03 06:03
shachafOh, come on, this channel is just a subset of #haskell.15/03 06:03
* copumpkin binds shachaf's hands15/03 06:03
shachafYou don't even have #agda-blah.15/03 06:03
sully02:03 < shachaf> Oh, come on, this channel is just a subset of #haskell.15/03 07:37
* sully not in #haskell15/03 07:37
copumpkinsully: clearly that should be fixed :)15/03 12:25
--- Day changed Wed Mar 16 2011
* copumpkin resumes some category theory16/03 02:28
* copumpkin throws Grothendieck into the bag16/03 02:28
copumpkingershwin will inspire16/03 02:45
copumpkinanyone know where setoid-respecting functions live in the standard library?16/03 03:12
copumpkinif anywhere16/03 03:13
copumpkinah, found it16/03 03:13
nappingwhere?16/03 03:20
copumpkinFunction.Equality16/03 03:41
* copumpkin has a category of setoids now16/03 03:41
* copumpkin should steal dolio's proof of pushouts16/03 03:42
dolioYes.16/03 03:42
* djahandarie should steal stuff from dolio more often, he seems very willing16/03 03:43
copumpkinmmm, almost done with grothendieck16/03 03:57
copumpkindone!16/03 04:43
nappingtopos?16/03 04:47
copumpkinnah, grothendieck constructions16/03 04:48
copumpkinI do have a subobject classifier lying around and do plan on building topoi later16/03 04:48
copumpkinwow, andrej bauer is on github now16/03 15:39
copumpkinhttps://github.com/andrejbauer/16/03 15:39
copumpkinapparently coq is now verilog, too16/03 15:40
copumpkincodolio: does the category of setoids have subobjects? I was thinking of a category of sigmaish setoids16/03 22:21
codolio"Have subobjects"?16/03 22:22
copumpkinhttp://en.wikipedia.org/wiki/Subobject ?16/03 22:23
codolioYes, I don't see any reason it wouldn't have those.16/03 22:25
copumpkinyeah, I guess16/03 22:26
codolioI thought maybe you meant a subobject classifier.16/03 22:26
codolioIn which case I'd tentatively say no.16/03 22:26
copumpkinwell, I did also mean that16/03 22:26
copumpkinbut not in that question16/03 22:26
codolioBut I'm not sure.16/03 22:26
copumpkinit is something I want, and have defined in my library, but I haven't "instantiated" it at all16/03 22:26
codolioThe subobject classifier in Agda, of sorts, is Set, but that's too big.16/03 22:27
copumpkinyeah16/03 22:27
copumpkinI guess we'd want a sort that contains only \top and \bot or something?16/03 22:27
copumpkinor something isomorphic to it16/03 22:27
codolioRight, but if you try to make that, it's Bool, which is decidable.16/03 22:28
copumpkinyea16/03 22:28
copumpkinmonosodium glutamate??16/03 22:36
nappingI'm not sure how that happened16/03 22:37
nappingSomething went wrong trying to msg NickServ16/03 22:37
nappingat least it wasn't typing a password into a logged channel16/03 22:37
shachafnapping: As far as typing a password is concerned, all channels are logged. :-)16/03 22:46
nappingof course16/03 22:46
nappingIs it possible to work with nonstandard analysis in type theory?16/03 22:47
nappingThat is, is there a more focused axiom you could assert to let you do the logical compactness stuff?16/03 22:48
--- Day changed Thu Mar 17 2011
Saizanhttp://hpaste.org/44830/aall <- i hope i won't need another level.17/03 00:05
codolioAAll {B} C = All (\t -> Sig (B t) (C t))?17/03 00:22
Saizanyes, but then i get problems like map fst x /= map fst (map (id &&& f) x), and i'd have to add a subst in some type signatures17/03 00:29
dolioAh.17/03 00:30
djahandariecopumpkin, aw, damn http://www.iis.sinica.edu.tw/~scm/2008/typed-lambda-calculus-interprete/, someone already beat me to writing this sort of article :)17/03 01:54
copumpkindjahandarie: doesn't stop you from writing another one :)17/03 01:56
copumpkinor make system F :P17/03 01:57
djahandarieNo, it doesn't ;)17/03 01:57
djahandarieSystem F would be too complicated for an intro article I think lol...17/03 01:57
djahandarieBy the way, all the Japanese folks on twitter have picked up Agda pretty damn fast17/03 01:57
copumpkin:P17/03 01:57
djahandarieIt took me MONTHS of idling before deciding to actually learn it!17/03 01:58
Mathnerd314goal: get agda to be a "trending topic" on twitter17/03 02:02
djahandarieAll tweets with the word "agda" in them tend to be in Spanish or whatever17/03 02:02
djahandarieI really need to unbrick my Agda install so I can continue my Agda hacking17/03 02:02
djahandarieI don't know what the hell happened to it but it just stopped working entirely, lol17/03 02:03
djahandarieIs there any formalization of universal polymorphism?17/03 03:45
djahandarieOr a paper on it17/03 03:45
djahandarie(Which I imagine would discuss that)17/03 03:46
dolioThere are papers on it.17/03 03:57
dolioI've never seen anything Agda-like.17/03 03:57
--- Day changed Fri Mar 18 2011
copumpkin"unordered heterogeneous pair"18/03 19:40
copumpkinwhat's a way of approaching that?18/03 19:40
copumpkinI guess it doesn't really make sense18/03 19:41
dolioNot really. The values are already distinguished by the type.18/03 19:55
dolioAnd it makes no sense for an operation to be commutative if its arguments can't be swapped due to type concerns.18/03 19:56
dolioUnless there's a left and right version of the operator that can reasonably be different from one another.18/03 19:57
dolioI guess there are situations like that.18/03 19:58
copumpkinyeah18/03 20:01
dolioThe one example I came up with is multiplication of matrices and vectors, though, and technically you can't just swap those around.18/03 20:05
dolioBut you can say that you transpose the vector in the necessary case.18/03 20:06
dolioAnd that wouldn't be commutative.18/03 20:06
dolioSquare matrices, of course.18/03 20:06
copumpkinyeah18/03 20:09
copumpkinhttp://homotopytypetheory.org/18/03 20:42
dolioYes, a second website for it.18/03 20:53
dolioI didn't know you could create a google group in the future.18/03 21:05
copumpkinwe used zombocom18/03 21:21
xplati am very interested in homotopy type theory18/03 22:52
copumpkingood!18/03 22:55
--- Day changed Sat Mar 19 2011
starclouded1hello everybody19/03 18:17
starclouded1how can I demonstrate the induction principle in this kind of datatype? data bTree (A : Set) : Set where19/03 22:13
starclouded1  empty : bTree A19/03 22:13
starclouded1  leaf  : A → bTree A19/03 22:13
starclouded1  node  : bTree A → bTree A → bTree A19/03 22:13
nappingwhat do you mean "demonstrate"?19/03 22:13
nappingYou can implement it with pattern matching19/03 22:13
copumpkinyou want a full dependent "induction principle"?19/03 22:14
nappingind empty leaf node Empty = empty ; ind empty leaf node (Leaf a) = leaf a; ind empty leaf node (Node l r) = node (ind empty leaf node l) (ind empty leaf node r)19/03 22:14
nappingwith appropriate type19/03 22:14
starclouded1I mean, first I have to do the base case so in my example it should be something like inbTree : {A : Set} (P : bTree A → Set) → P empty → ?19/03 22:18
starclouded1any ideas?19/03 22:29
copumpkinoh, so the full dependent induction principle19/03 22:30
copumpkinstate its full type19/03 22:31
copumpkinthe definition should basically write itself :P19/03 22:31
copumpkinuse C-c C-a (With -c in the hole)19/03 22:31
nappingwhere are the hints descrbied?19/03 22:33
copumpkinhttp://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.Auto19/03 22:33
starclouded1right now I am trying to write the constructor part19/03 22:34
nappingwhere is it linked from?19/03 22:34
copumpkinhttp://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.HomePage19/03 22:35
copumpkinauto19/03 22:35
nappingah, I went straight to the documentation page19/03 22:36
starclouded1any help with the Induction principle on trees?19/03 22:51
copumpkinstarclouded1: I just told you what I'd do19/03 22:51
nappingas did I19/03 22:51
nappingcopumpkin: can you get string fuctions to reduce in C-c C-n?19/03 22:52
copumpkinhmm, I've never written any string functions in agda19/03 22:52
nappingwith things just postulated as suggested on FFI page they do not19/03 22:52
nappingand trying to bind it to an actual data type behaves oddly.19/03 22:53
nappingdata String : Set where s : String {-# BUILDING STRING String #-}19/03 22:53
nappingI should make a bug report, actually19/03 22:53
nappingI get "Incomplete pattern matching" when applying a function on String to "test"19/03 22:57
copumpkinBUILTIN?19/03 22:58
copumpkin:)19/03 22:58
nappingyeah, it was actually BUILTIN19/03 22:58
starclouded1copumpkin: I first have to do the constructor part, the thing you suggest is for the definition, no?19/03 22:58
nappingstarclouded1: what constructor part?19/03 22:58
copumpkinwrite the type of the function you want to write19/03 22:58
nappingan induction principle is not a data type19/03 22:58
copumpkinyou started writing it19/03 22:58
copumpkinfinish it off19/03 22:59
copumpkinthe code will practically write itself once you have the type19/03 22:59
nappingIs anyone working on optimizing the Agda implementation?19/03 23:00
nappingI think I need to s/String/Text/g for a first step, or buy more memory19/03 23:00
starclouded1I need to define a data type that is polimorphic, recursive and demonstrate the principle of induction for this data type19/03 23:02
nappingYou've written the data. Now listen to copumpkin and write the induction principle19/03 23:03
copumpkinyou wrote "inbTree : {A : Set} (P : bTree A → Set) → P empty → ?"19/03 23:03
copumpkinwhat's the ?19/03 23:03
starclouded1the part I don't know19/03 23:04
copumpkinthere's one P for each constructor19/03 23:04
copumpkinwhat do you return?19/03 23:04
copumpkininbTree : {A : Set} (P : bTree A → Set) → P empty → ? -> ? -> (forall x -> P x)19/03 23:05
copumpkinyou have the list induction principle19/03 23:06
copumpkinyou showed it to me19/03 23:06
copumpkinextrapolate a bit :)19/03 23:06
nappingthe Data.String definitions seem to work19/03 23:11
nappingIt actually uses primitives, rather than ffi bindings, so they do reduce19/03 23:12
copumpkinah19/03 23:12
copumpkinwhat are you doing with strings, anyway?19/03 23:13
copumpkinthat's awfully runtimey :P19/03 23:13
nappingreading some things about mixfix parsers19/03 23:13
nappingbesides, how is Agda ever going to be the next big language without a web framework?19/03 23:14
copumpkinit already has one!19/03 23:15
copumpkinhttps://github.com/larrytheliquid/Lemmachine19/03 23:15
nappingExcellent19/03 23:21
nappingI should file a real bug, actually.19/03 23:21
nappingIf you import a module with a using clause, it should only import the names you mention, right?19/03 23:22
djahandarieHm, larry seems to have not committed anything for awhile19/03 23:22
nappingfor some reason, I couldn't define my own _\le_ after importing Data.Nat using (...)19/03 23:22
copumpkinhide module _\le_19/03 23:22
copumpkinI think19/03 23:23
nappingoh, so using doesn't control visilibity of child modules19/03 23:23
copumpkinnot sure, but it might hlep19/03 23:24
starclouded1what  is wrong with this induction on trees19/03 23:55
starclouded1inTree : {A : Set} (P : bTree A → Set) →19/03 23:55
starclouded1       P empty →19/03 23:55
starclouded1       (∀ bt → (bt : bTree A) → P bt → P leaf) →19/03 23:55
starclouded1       (∀ bt → (bt : bTree A) → P bt → P node) →19/03 23:55
starclouded1       (bt : bTree A) → P bt19/03 23:55
copumpkinleaf and node aren't values of type bTree A19/03 23:59
copumpkinso can't be passed to P19/03 23:59
copumpkinalso, the two inner functions don't really make sense19/03 23:59
copumpkinI'd imagine the forall bt is yellow19/03 23:59
--- Day changed Sun Mar 20 2011
starclouded1so what should I pass to P?20/03 00:15
starclouded1how about this ∀ bt (λ bt → (A → bTree A)) → P bt → P leaf empty20/03 00:24
starclouded1???20/03 00:24
copumpkinstarclouded1: you're just guessing now...20/03 00:32
starclouded1a little help please20/03 00:44
copumpkinstarclouded1: what's the list one?20/03 00:56
copumpkinstarclouded1: you gave me indList : {A : Set}(P : List A → Set) → P [] → (∀ x → (xs : List A) → P xs → P (x ∷ xs)) → (xs : List A) → P xs before20/03 03:18
copumpkinnote how that can be seen in the same form20/03 03:18
copumpkinindList : {A : Set}(P : List A → Set) → P [] → (∀ x → (xs : List A) → P xs → P (x ∷ xs)) → forall xs → P xs20/03 03:19
copumpkinwhat's the pattern there?20/03 03:20
copumpkinyou have20/03 03:20
copumpkinP []20/03 03:20
copumpkinand20/03 03:20
copumpkin(∀ x → (xs : List A) → P xs → P (x ∷ xs))20/03 03:20
copumpkinthen it returns a forall x -> P x20/03 03:22
starcloudedhello everybody20/03 14:06
starcloudedanyone could help me with this code20/03 14:14
starcloudedinTree : {A : Set}(P : bTree A → Set) →20/03 14:14
starclouded       P empty →20/03 14:14
starclouded       (∀ x → (λ x → (A → bTree A))) → P x → P leaf20/03 14:14
starcloudeddata bTree (A : Set) : Set where20/03 14:15
starclouded  empty : bTree A20/03 14:15
starclouded  leaf  : A → bTree A20/03 14:15
starclouded  node  : bTree A → bTree A → bTree A20/03 14:15
starcloudedany ideas?20/03 14:35
Saizanfirethe tipe of inTree doesn't look correct20/03 14:46
kosmikusyes, but I also don't understand what the question actually is20/03 14:46
starcloudedI am trying to do induction on trees20/03 14:48
starcloudedcase 1: P empty20/03 14:48
starcloudedcase 2: (∀ x → (λ x → (A → bTree A))) → P x → P leaf20/03 14:49
kosmikuswhy do you have 2 cases?20/03 14:50
starcloudedIt suppose to have 3 cases20/03 14:50
kosmikusyes, that seems better20/03 14:51
starcloudedbut the thing is that I don't know what Im doing wrong with the second case20/03 14:51
kosmikusdo you know how to do induction on a bTree? (informally, I mean)20/03 14:52
kosmikusor how did you come up with the type you have there?20/03 14:53
npouillardInspecting the one for lists may help {A : Set} (P : List A → Set) (P[] : P []) (P∷ : (x : A) {xs : List A} → P xs → P (x ∷ xs)) (xs : List A) → P xs20/03 14:54
hipsterpumpkinI tried that yesterday, and it didn't20/03 14:55
starcloudedI just find it in some example20/03 14:56
* kosmikus reads backlog20/03 14:56
hipsterpumpkinstarclouded: so intuitively, an induction principle on trees20/03 14:56
starcloudedyesterday I looked the induction on lists trying do something with trees but I don't achieve success20/03 14:58
hipsterpumpkinshould have three cases, one for the empty tree, one for a leaf, and one for the recursive case. The recursive one should recurse "twice", that is take P leftSutree, P rightSutree, and give you P (node leftSubtree rightSubtree)20/03 14:58
hipsterpumpkinso yhou know that one case is P empty20/03 15:00
starcloudeddefining the constructor I'm stuck, cause when I define de case 2: (λ le → (A → bTree A)) → P le → P leaf it throws and error not in scope: le20/03 15:00
hipsterpumpkinum20/03 15:01
hipsterpumpkinif you write f = (λ x -> x + 1) + x, do you think that makes sense?20/03 15:03
hipsterpumpkin(assuming that's the only code you have)20/03 15:03
starcloudedI think not, but I do need and element of (A -> bTree) and because of that I do the lambda abstraction, no?20/03 15:06
hipsterpumpkinI think you're very confused...20/03 15:09
hipsterpumpkinmy point is that when you write  (λ le → (A → bTree A)) → P le → P leaf it20/03 15:09
hipsterpumpkinle only exists within the scope of that lambda20/03 15:09
hipsterpumpkinso when you try to reference it outside the parentheses there, it doesn't exist anymore20/03 15:09
hipsterpumpkinalso, P takes one argument20/03 15:09
hipsterpumpkinso P leaf it doesn't make sense20/03 15:10
hipsterpumpkinP (leaf it) might, but you don't have a value called it in scope20/03 15:10
starcloudedit should be something like this: (∀ x → (bt : bTree A) → P bt → P (x bt))20/03 15:14
starclouded?20/03 15:15
hipsterpumpkin{A : Set} (P : List A → Set)20/03 15:16
hipsterpumpkinP empty20/03 15:16
hipsterpumpkin(forall x -> P (leaf x))20/03 15:16
hipsterpumpkin(P left -> P right -> P (node left right))20/03 15:16
hipsterpumpkinforall x -> P x20/03 15:16
hipsterpumpkinand by P : List a -> Set I mean P : Tree a -> Set20/03 15:17
hipsterpumpkinthe pattern is that you have one parameter per constructor, and very closely reflects the structure of each constructor20/03 15:18
hipsterpumpkingah20/03 15:19
hipsterpumpkinI wrote it wrong20/03 15:19
hipsterpumpkinwell, there's quantification over the left and right, obviously20/03 15:19
hipsterpumpkinstarclouded: in that option, you aren't using bt20/03 15:25
hipsterpumpkinyou just ask for it and then ignore it20/03 15:25
starcloudedit could be writed like this (∀ x → (bt : bTree A) → P bt → P (leaf x))20/03 15:26
hipsterpumpkinhow is that any different from (∀ x → P (leaf x))20/03 15:26
hipsterpumpkinthe pattern is to look at the data definition20/03 15:27
hipsterpumpkinyou have empty : Tree a20/03 15:28
hipsterpumpkinso your parameter for empty takes no parameters20/03 15:28
hipsterpumpkinleaf  : A → bTree A20/03 15:28
hipsterpumpkinthat one takes a non-bTree parameter (i.e., not a recursive tree constructor)20/03 15:28
hipsterpumpkinso you pass it one for your induction case20/03 15:29
hipsterpumpkin(forall x -> P (leaf x))20/03 15:29
hipsterpumpkinnode  : bTree A → bTree A → bTree A20/03 15:29
hipsterpumpkinthat one recurses twice20/03 15:29
hipsterpumpkinit takes two bTrees20/03 15:29
hipsterpumpkin(P left -> P right -> P (node left right))20/03 15:29
hipsterpumpkin(you want to quantify locally over left and right)20/03 15:29
hipsterpumpkinso ({left right : bTree a} -> P left -> P right -> P (node left right))20/03 15:30
hipsterpumpkinit takes two Ps because the bTree constructor has two bTree parameters20/03 15:30
hipsterpumpkindo you understand conceptually what induction is doing?20/03 15:31
starcloudedyes I'm doing now20/03 15:33
hipsterpumpkinin the usual induction terms, you might say you have "two base cases"20/03 15:33
hipsterpumpkinand one "inductive case"20/03 15:33
hipsterpumpkinor something like that20/03 15:33
hipsterpumpkinthe base cases are the ones that have no recursion in them20/03 15:33
hipsterpumpkinconceptually, induction in a language like agda is just like recursion20/03 15:34
starcloudedthanks for the help20/03 15:38
hipsterpumpkinanyway, once you have the type, agda can pretty much write the definition for you20/03 15:39
benmachineI'm confused20/03 21:42
copumpkinhow come?20/03 21:43
benmachinewell, I am generally confused, but also in particular20/03 21:43
benmachinedata Surjection (A B : Set) : Set where20/03 21:43
benmachine  surjection : (f : A → B)20/03 21:43
benmachine    → ((x : B) → ((y : A) × (f y == x)))20/03 21:43
benmachine    → Surjection A B20/03 21:43
benmachinethis is going parse error at me20/03 21:43
benmachineon the \x I think20/03 21:43
copumpkinoh, yeah20/03 21:44
copumpkinyou're treating \x as a binder20/03 21:44
benmachinea binder?20/03 21:44
copumpkinas binding that y there20/03 21:44
benmachineoh right20/03 21:45
copumpkinyou're going to want Sigma A (lambda y -> f y == x)20/03 21:45
benmachinesigma?20/03 21:45
benmachineoo er20/03 21:45
copumpkinbasically exists20/03 21:45
Saizan\Sigma20/03 21:45
copumpkinthere's a syntax for it20/03 21:45
copumpkinbut I can never remember what it looks like20/03 21:45
copumpkinbenmachine: keep in mind that a constructive surjection is a bit "stronger" than a classical one :P20/03 21:46
benmachinecopumpkin: eek. how so?20/03 21:46
benmachine(also I'm still confused about the sigma thing, how does that work?)20/03 21:46
copumpkinyou're basically providing an inverse for the function f there20/03 21:46
benmachinebasically yes20/03 21:47
copumpkinsigma is a dependent pair20/03 21:47
copumpkintwo values, such that the type of the second can depend on the value of teh first20/03 21:47
benmachineI considered defining Surjection as "has right inverse" but this way is more natural to me20/03 21:48
benmachineok, is it builtin?20/03 21:48
copumpkinnope20/03 21:48
benmachineoh right20/03 21:48
copumpkinyou can write it easily, or use Data.Product in standard library20/03 21:48
benmachineah, basically just use a type function for the second part rather than a type20/03 21:48
benmachinepresumably it is just as capable as a conventional pair20/03 21:48
benmachinedo you need a pair once you've got it?20/03 21:49
copumpkinyeah, Sigma : (A : Set) -> (A -> Set) -> Set20/03 21:49
copumpkindo you need one in what sense?20/03 21:49
benmachineI mean can't you just use Sigma instead of \x20/03 21:49
SaizanA \x B = Sigma A (\ _ -> B)20/03 21:50
Saizanthat's how it's defined in Data.Product, in fact20/03 21:50
benmachineah ok20/03 21:51
benmachinefair enough20/03 21:51
copumpkinit's called Sigma because it's also called a dependent sum (S)20/03 21:51
benmachineit's a dependent product isn't it?20/03 21:52
* benmachine confuse20/03 21:52
copumpkinno20/03 21:52
copumpkinthe naming is very confusing20/03 21:52
copumpkindependent _pairs_ are also called dependent _sums_, and dependent _functions_ are also called dependent _products_ :)20/03 21:53
benmachineah20/03 21:53
benmachineI guess a dependent Either doesn't make sense20/03 21:53
copumpkinit's because you can consider the fst half of the pair as an "index" into an arbitrary sum20/03 21:53
benmachineoh right20/03 21:53
copumpkinand the domain of the function as an index into an arbitrary tuple20/03 21:53
copumpkinso just like Bool -> a in haskell is mostly isomorphic to (a, a)20/03 21:54
benmachineoh right20/03 21:54
copumpkina dependent (x : Bool) -> if x then a else b is exactly isomorphic to (a, b)20/03 21:54
copumpkinsame with sums20/03 21:55
benmachinefair enough20/03 21:55
djahandarieHi benmachine20/03 22:02
djahandarieI need to learn Agda faster before everyone else learns it faster than me :<20/03 22:03
--- Day changed Mon Mar 21 2011
jmcarthuri have a type error for some simple code that i would appreciate somebody helping me with. http://hpaste.org/44918/simple_pattern_match_error21/03 04:32
jmcarthuri've been looking at agda for a long time, but i'm as much of a noob as ever :)21/03 04:32
jmcarthurin this case, i don't see what it is exactly that i need to tell agda to make it believe this is a valid case21/03 04:32
jmcarthur*exactly what21/03 04:33
copumpkinI can see what you're building here :P21/03 04:33
jmcarthurthis is distilled from a larger chunk of code, but the type error is essentially the same21/03 04:33
jmcarthurheh, yes21/03 04:33
jmcarthurwell, this is a fairly typical dependent context sort of thing, but i'm playing with a more unusual way to represent binders. i'm pretty sure that is unrelated to this error though21/03 04:35
jmcarthurconsidering nothing relating directly to binders appears here ;)21/03 04:36
jmcarthuranyway, even leaving the rhs as a hole gives the same error21/03 04:37
jmcarthuri should have done that to make it clearer21/03 04:38
jmcarthurhere's the same with an attempt to C-c C-c it21/03 04:41
jmcarthurhttp://hpaste.org/paste/44918/simple_pattern_match_error_an#p4491921/03 04:41
copumpkinit works fine if you don't use agda functions21/03 04:55
copumpkinwhy are you using agda function arrows there? not quite sure why it doesn't work with them there though21/03 04:55
dolioType constructors are no longer injective.21/03 04:57
copumpkinoh, I see21/03 04:58
copumpkinoh I remember a discussion on that a while back on the mailing list21/03 04:58
djahandarieI remember that too21/03 04:59
jmcarthuri don't think i know what you mean by "agda function arrows" or what the alternative is21/03 04:59
copumpkinjmcarthur: typically I'd use an ADT representation of your lambda calculus' types21/03 04:59
jmcarthure.i.?21/03 05:00
jmcarthurerr...   *e.g.?21/03 05:00
copumpkinhttp://hpaste.org/44920/zomg21/03 05:00
jmcarthurcopumpkin: the idea was that i could also have a constructor to inject agda values into it, like   prim : a -> Test a21/03 05:03
jmcarthurwell....    prim : a -> Test [] a21/03 05:03
jmcarthuror whatever21/03 05:04
copumpkinah hmm21/03 05:05
copumpkinI think there's an option for injective type constructors, but they mess with things I think21/03 05:05
jmcarthurchecks changelogs21/03 05:05
jmcarthur* /me21/03 05:05
dolio--injective-type-constructors, probably.21/03 05:07
dolioThey're anti-classical.21/03 05:07
copumpkin:o21/03 05:07
dolioAnd anti-impredicative, too, I think.21/03 05:07
copumpkinfun21/03 05:07
jmcarthurwell, does anybody know of a way i could get this to sort of work without --injective-type-constructors ?21/03 05:07
dolioUse the ADT like copumpkin said.21/03 05:07
jmcarthur:\21/03 05:08
jmcarthuralright21/03 05:08
jmcarthuri was planning to port to haskell once i worked some things out anyway. i guess i can just add primitives back in once i do that21/03 05:08
copumpkinyou could have a Prim type in the ADT representing agda types, maybe21/03 05:08
jmcarthuryeah, i could just use an ADT for the language primitives21/03 05:10
jmcarthuri was just wanting to have the primitives type checked21/03 05:10
copumpkinhm21/03 05:11
copumpkinyou can run arbitrary type functions though21/03 05:11
copumpkinyou might have [_] : Moo -> Set21/03 05:11
copumpkinand your Set-holding constructor in Moo can just return the inner value21/03 05:12
jmcarthurhmm21/03 05:14
copumpkinI think that should be okay21/03 05:15
jmcarthurso instead of tt : Moo, i would have something like... umm...    prim : {A : Set} -> A -> Moo  ?21/03 05:16
copumpkinSet -> Moo21/03 05:17
copumpkinMoo needs to be bigger though21/03 05:17
copumpkinactually21/03 05:17
copumpkinmaybe not21/03 05:17
copumpkinyeah, it does21/03 05:17
jmcarthurbut this still means i can't evaluate an expression and get a value from it, right?21/03 05:18
jmcarthuri can only get a lambda expression as a result?21/03 05:19
copumpkin?21/03 05:19
copumpkinit'll evaluate as far as it's possible to evaluate21/03 05:19
jmcarthurif prim : Set -> Moo, i still haven't injected a value21/03 05:19
jmcarthuroh21/03 05:20
jmcarthuri was thinking of Moo at the value level, but it's at the type level anyway21/03 05:20
jmcarthuri would still have prim in Test then, i guess21/03 05:20
jmcarthuri am still unused to thinking in dependent types21/03 05:20
copumpkinMoo represents your types, yeah21/03 05:21
copumpkinyou'd have an "evaluator" from Moo to agda types21/03 05:21
jmcarthuryeah, a separate evaluator from the term evaluator21/03 05:21
copumpkinyep21/03 05:21
copumpkinand the term evaluator's type is expressed in terms of the type evaluator21/03 05:21
jmcarthuryeah i see21/03 05:21
jmcarthurthanks, i think i'll give this a shot21/03 05:22
copumpkincool21/03 05:22
copumpkinI have something like this if you'd like to see it21/03 05:22
jmcarthuri'd love to21/03 05:22
djahandarieWith highlighting!21/03 05:22
copumpkinhttp://pumpkinpat.ch/moo.html21/03 05:22
copumpkin:P21/03 05:22
copumpkinit was more of a showcase for my highlighter than actual code I wanted to publish21/03 05:23
copumpkinbut it's become my goto example for this stuff :P21/03 05:23
jmcarthurah i remember this21/03 05:23
jmcarthurthanks!21/03 05:23
copumpkinI should really put in an eliminator for the empty type21/03 05:23
dolioIn your category lib?21/03 05:25
dolioNot having one tends to cause problems.21/03 05:25
dolioBecause \() is generative.21/03 05:25
copumpkinoh no, in that STLC thing I keep throwing around21/03 05:26
copumpkinit's supposedly a type somewhere21/03 05:26
dolioOh.21/03 05:26
copumpkinbut you can't interact with it at all21/03 05:26
djahandarieDid I show you this btw copumpkin? http://althack.org/stlc.html Ends midsentence but it's something at least. :P21/03 05:28
copumpkinoh nice21/03 05:28
* copumpkin reads21/03 05:28
djahandarieI was rewriting the code when I stopped actually21/03 05:28
djahandarieYou won't learn anything from it :P21/03 05:28
djahandarieAlso, nb: I have not edited this at all. Probably rocky in some places21/03 05:29
copumpkinlooks good :)21/03 05:31
jmcarthurcopumpkin: it seems to be a lot less problematic now. thanks again21/03 05:32
copumpkinno problem21/03 05:32
Saizanany particularly good way to formalize vector spaces?21/03 08:48
copumpkinSaizan: apart from just stating algebraic laws abstractly?21/03 14:03
Saizancopumpkin: afaiu every vector space is a free one over some basis, so you should be able to do better than that21/03 14:10
Saizansigfpe uses Vec k b = [(k,b)] in haskell, but that's a bit too liberal21/03 14:12
copumpkinwell, do you want to restrict it to being finite?21/03 14:12
Saizannot ideally, but it wouldn't hurt much i guess.. the idea is to do some quantum physics over it :)21/03 14:15
danrwhat's a reasonable way to do finite lists in haskell?21/03 14:15
copumpkindanr: just use data21/03 14:15
copumpkinSaizan: ooh!21/03 14:15
copumpkinSaizan: wait, are you going to invent the reals first? :P21/03 14:15
copumpkinor rational quantum physics? :o21/03 14:15
danrcopumpkin: well if we want to enforce them to be finite?21/03 14:15
copumpkinor do you not need them?21/03 14:15
copumpkindanr: data does that for you21/03 14:15
Saizani could use an axiomatization for the reals :D21/03 14:16
copumpkinyou'd need to explicitly allow them to be infinite by making them codata21/03 14:16
danrwell i'm talking about haskell actually :O21/03 14:16
copumpkinoh21/03 14:16
copumpkinmake the recursion strict21/03 14:16
copumpkinthat's as close as you're going to get21/03 14:16
danrwith bang patterns maybe?21/03 14:17
copumpkinyeah21/03 14:17
copumpkinwell, bang on fields21/03 14:17
copumpkinwhich is actually part of h9821/03 14:17
xplathuh?  type constructors are not injective?!21/03 21:24
Saizanthey are for type inference purpouses only21/03 21:24
benmachinefor type inference porpoises21/03 21:25
xplatoh, type constructors not data constructors.  but still ...21/03 21:25
Saizanit's anti-classical to have them injective, apparently21/03 21:27
xplati wonder how that works ... wouldn't have expected it21/03 21:30
xplatanti-impredicative i could easily buy ...21/03 21:30
Saizanit starts with data F : (Set -> Set) -> Set where, iirc, there's a thread on the mailing list21/03 21:32
xplatand how can you have them injective for type inference but not for other purposes?21/03 21:33
Saizani guess because within the logic you can't confute the injectivity21/03 21:34
xplathm, okay, i see that the problems come in when you have higher-kinded type constructors21/03 21:37
xplatsince (Set -> Set) -> Set in this case takes general type functions as parameters rather than just other (injective and non-overlapping) constructors21/03 21:38
Saizanthe point is that you can build a cantor-like argument, iirc21/03 21:40
dolioIt requires excluded middle or impredicativity to go through, though.21/03 21:41
dolio(Possibly not an exhaustive list.)21/03 21:41
xplatwell, (Set -> Set) -> Set is an impredicative type, and you can diagonalize on it but only classically21/03 21:42
dolio(Set -> Set) -> Set isn't the impredicativity I'm talking about, if you even consider it such.21/03 21:43
dolioThe (Set -> Set) -> Set in the argument is parameterized by the first argument, not indexed by it.21/03 21:43
xplatoh, you need a stronger impredicativity21/03 21:44
xplati did not realize this21/03 21:44
* Saizan doesn't see (Set -> Set) -> Set as impredicative21/03 21:44
dolioIf you want to disallow the former, you have to do things like disallow the definition of Sets inside modules that take (Set -> Set) as a parameter.21/03 21:44
xplathm, that would be troublesome to disallow21/03 21:45
* Saizan hugs higher-kinded polymorphism21/03 21:45
xplati wish gmane didin't suck so much21/03 21:45
dolioAnd the definition looks like: 'data J (F : Set -> Set) : Set where'.21/03 21:45
dolioBeing the empty type, I think.21/03 21:45
dolioxplat: I think the thread was titled something like 'is agda + excluded middle inconsistent'.21/03 21:46
dolioI have it saved in a file if you just want me to paste it.21/03 21:47
dolioMine is formatted a little nicer, too, I think. :)21/03 21:47
xplathm, that would be nice21/03 21:49
dolioDid that get through?21/03 21:53
xplatnot sure what it was, but i didn't see anything get through ...21/03 21:55
doliohttp://hpaste.org/44932/injective_tycons__excluded_mi21/03 21:55
xplataha, thanks21/03 21:56
dolioYou'll have to search the coq-club for the interaction with impredicativity.21/03 22:05
dolioThat's a real pain to mimic in Agda.21/03 22:05
dolioAside from --type-in-type, I guess.21/03 22:05
starclouded1helo everybody21/03 23:48
--- Day changed Tue Mar 22 2011
starclouded1anyone knows how to define the neutral element of the multiplication?22/03 00:11
dolioSo, how much memory does the average pumpkin use when developing Agda.22/03 02:00
dolioThat should end with a question mark.22/03 02:01
copumpkintypechecking Everything.agda took about 800MB last I checked, but when I was actually working on some modules like NaturalTransformation.agda, it took up to about 1.4 I think22/03 02:01
dolioEverything from your category lib?22/03 02:01
copumpkinyeah22/03 02:01
dolioThat's not actually that bad.22/03 02:02
copumpkinI think it takes about 10 minutes or so on my machine22/03 02:02
copumpkinmaybe 1522/03 02:02
copumpkinnever really timed it22/03 02:02
copumpkinI usually go off and do something else22/03 02:02
dolioYeah.22/03 02:02
copumpkinyeah, it's more bearable than I thought it'd be22/03 02:02
copumpkinI'll be pretty happy with it once the irrelevant modules thing happens, and I can rearchitect the whole structure to actually avoid opening modules right left and center22/03 02:05
copumpkinwell, and when I start implementing some of the more interesting structures and proofs about them22/03 02:06
copumpkinlots of distractions recently though22/03 02:06
xplatirrelevant modules?22/03 03:06
copumpkinbeing able to open something that's marked irrelevant such that everything in it becomes irrelevant22/03 03:08
npouillardI'm looking for some papers to cite in reference for the intruction/use of the 'Fin' d22/03 09:16
npouillarddata type in the context of representing binders.22/03 09:16
jmcarthurwhat exactly do the underscore-prefixed numbers mean in error messages, like in:  "_492 f ts us ∷ _493 f ts us != us of type List Type"?22/03 15:01
jmcarthurin this case it is just "some type constructed from t, ts, and us"?22/03 15:01
jmcarthur*t, ts, and us22/03 15:01
jmcarthur**f, ts, and us22/03 15:01
Saizanjmcarthur: those are metavariables used during type inference22/03 15:03
Saizanthe "arguments" are what is in scope for that variable22/03 15:03
jmcarthurmaybe i should have said "some type constructed from f, ts, *or* us" then?22/03 15:04
Saizannot necessarily a type though22/03 15:04
jmcarthurah right22/03 15:04
Saizan(and it can ignore or use as it likes any of its arguments)22/03 15:05
jmcarthuri am still so used to phase distinction that unification is still at the type level in my head22/03 15:05
jmcarthurbadly worded again i think22/03 15:05
jmcarthuri'll just say i'm still unused to dependent types22/03 15:05
jmcarthurthanks22/03 15:05
djahandarieIt would be nice if someone fully decrypted the Agda errors messages for the layman22/03 15:07
djahandarieI've come to recognize a couple of them but I don't really understand what those things mean, just where I need to look to find the source of the error22/03 15:07
Saizanmy main problem with them is that they sometimes totally miss the point, but that's not really agda specific22/03 15:10
xplatwas the question about ≝ in here?  it's \defeq i think ...22/03 15:26
* xplat boggles at ⊥ being called \perp and ⊤ being called \bot22/03 15:30
Saizanwhere?22/03 15:41
jmcarthurxplat: what?22/03 15:43
jmcarthurthey are \bot and \top for me, respectively22/03 15:43
jmcarthuri think perp and bot are different code points, but i'm not sure22/03 15:44
xplatmaybe this is an error in the translation from latex to IM table ...22/03 15:46
joe6is agda a natural progression from haskell?22/03 15:58
copumpkinit's not strictly better or worse22/03 15:58
copumpkinbut it's an interesting step22/03 15:58
benmachineit probably helps a lot if you know haskell before learning agda22/03 15:59
copumpkinyeah22/03 15:59
benmachineso agda is higher up in the tech tree :P but it's really a different sort of thing I think22/03 16:00
copumpkinwell, you'd have no trouble with haskell if you started with agda, either22/03 16:00
copumpkinprobably22/03 16:00
copumpkinI don't think that's ever happened though22/03 16:00
joe6ok, thanks.22/03 16:00
joe6i am looking for a prolog in haskell. (there is the logic monad in haskell), but just curious, if agda can do something like that.22/03 16:02
copumpkintype-level programming in haskell is somewhat similar to logic programming, but a lot more constrained I guess22/03 16:03
joe6but, on a different note, agda is pretty cool. I was just checking out the first tutorial pdf..22/03 16:03
copumpkinbut agda doesn't have any additional magic for it, no22/03 16:03
copumpkinit comes with a lot less22/03 16:03
Saizanfor dependent logic programming there's twelf22/03 16:03
copumpkinit has no standard library22/03 16:03
Saizan(though it's much more geared towards a proof assistant)22/03 16:04
joe6oh, ok. it should be straightforward to do something like that in agda?22/03 16:04
joe6don't bother.22/03 16:04
joe6i need to learn agda more before spewing out stuff like that.22/03 16:04
xplatcopumpkin: roconnor is an example of agda first, then haskell iirc22/03 16:32
Saizancoq first, actually22/03 16:32
xplatoh, right, i didn't rc22/03 16:33
jmcarthurinterestin22/03 16:39
jmcarthurg22/03 16:39
djahandarieCoq is a different beast though22/03 16:55
djahandarieIt's far more on the proof-assistant based on intuitionistic type theory side of things ;)22/03 16:55
starcloudedhello everybody22/03 19:37
starcloudedwhat is the difference defining between this22/03 19:42
starclouded_$_ : {A : Set} {B : A → Set} →22/03 19:42
starclouded      ((x : A) → B x) → ((x : A) → B x)22/03 19:42
starcloudedf $ x = f x22/03 19:42
starcloudedand this22/03 19:42
starclouded_$_ : ∀ {a b} {A : Set a} {B : A → Set b} →22/03 19:42
starclouded      ((x : A) → B x) → ((x : A) → B x)22/03 19:42
starcloudedf $ x = f x22/03 19:42
djahandarieThe second generalizes to any universe, I think.22/03 19:43
djahandarie{a : Level} {b : Level}22/03 19:43
djahandarieIf it says universal-polymorphism at the top of the file, then this is indeed what it is :)22/03 19:46
starcloudedbut I the risk of using the first instead of the second? in this case22/03 19:51
starclouded  m*1+n≡m+mn : ∀ m n → m * suc n ≡ m + m * n22/03 19:51
starclouded  m*1+n≡m+mn zero    n = refl22/03 19:51
starclouded  m*1+n≡m+mn (suc m) n =22/03 19:51
starclouded    begin22/03 19:51
starclouded      suc m * suc n22/03 19:51
starclouded    ≡⟨ refl ⟩22/03 19:52
starclouded      suc n + m * suc n22/03 19:52
starclouded    ≡⟨ cong (λ x → suc n + x) (m*1+n≡m+mn m n) ⟩22/03 19:52
starclouded      suc n + (m + m * n)22/03 19:52
starclouded    ≡⟨ refl ⟩22/03 19:52
starclouded      suc (n + (m + m * n))22/03 19:52
starclouded    ≡⟨ cong suc (sym $ +-assoc n m (m * n)) ⟩22/03 19:52
starclouded      suc (n + m + m * n)22/03 19:52
starclouded    ≡⟨ cong (λ x → suc (x + m * n)) (+-comm n m) ⟩22/03 19:52
starclouded      suc (m + n + m * n)22/03 19:52
starcloudedwhat is the risk of using the first instead of the second one in this case22/03 19:53
starclouded m*1+n≡m+mn : ∀ m n → m * suc n ≡ m + m * n22/03 19:53
starclouded m*1+n≡m+mn zero    n = refl22/03 19:53
starclouded m*1+n≡m+mn (suc m) n =22/03 19:53
starclouded   begin22/03 19:53
starclouded     suc m * suc n22/03 19:53
starclouded≡⟨ cong (λ x → suc n + x) (m*1+n≡m+mn m n) ⟩22/03 19:53
starclouded     suc n + (m + m * n)22/03 19:53
starclouded   ≡⟨ refl ⟩22/03 19:53
starclouded     suc (n + (m + m * n))22/03 19:53
starclouded   ≡⟨ cong suc (sym $ +-assoc n m (m * n)) ⟩22/03 19:53
starclouded     suc (n + m + m * n)22/03 19:53
starclouded≡⟨ cong suc (sym $ +-assoc n m (m * n)) ⟩22/03 19:53
starclouded     suc (n + m + m * n)22/03 19:53
starclouded   ≡⟨ cong (λ x → suc (x + m * n)) (+-comm n m) ⟩22/03 19:53
starclouded     suc (m + n + m * n)22/03 19:53
starclouded   ≡⟨ cong suc (+-assoc m n (m * n)) ⟩22/03 19:53
starclouded     suc (m + (n + m * n))22/03 19:53
starclouded   ≡⟨ refl ⟩22/03 19:53
starclouded     suc m + suc m * n22/03 19:53
starclouded   ∎22/03 19:53
Saizanyou shouldn't paste that many lines of code in the channel22/03 19:56
Saizananyhow, they'll both do the same thing22/03 19:56
Saizanthough you can't have them both in scope, because the name resolver doesn't care about what they do22/03 19:56
xplati have to say, the common pattern of using anexpressionrunalltogetherwithnospaces as a variable name was something i didn't expect as a result of agda's requirement of whitespace between (almost) all lexemes22/03 20:03
xplati'm not sure if i love it or hate it22/03 20:03
xplatit sure is handy in equality proofs22/03 20:04
xplatit's not like there are a ton of obvious good names for the evidence, after all22/03 20:05
Saizanyeah22/03 20:09
--- Day changed Wed Mar 23 2011
starcloudedhello everybody23/03 03:46
starcloudedI have a question according to the standard library the conmutative of the natural numbers in the first case is this *-comm zero    n = sym $ proj₂ *-zero n23/03 03:53
starcloudedis there another way of defining the this case?23/03 03:54
starcloudedany help??23/03 04:08
copumpkinthere are several minor variations23/03 04:10
copumpkinwhat are you looking for?23/03 04:10
joe6can agda be used with haskell libraries?23/03 05:01
joe6or, does it need a FFI or something?23/03 05:01
copumpkinit has an FFI to haskell23/03 05:03
joe6copumpkin, thanks. Any suggestions on what is best tutorial to agda?23/03 05:18
copumpkinI normally just recommend the 2008 tutorial paper23/03 05:18
copumpkinit's pretty clear I think23/03 05:18
joe6ok, thanks.23/03 05:21
nappingData.Fin.#_ is an impressive function23/03 06:02
copumpkinwhat's it do?23/03 06:06
nappingconverts an integer into a Fin23/03 06:06
copumpkina natural?23/03 06:07
nappingexcept, it infers the index of Fin, then uses the computable <= on nat in such a way that it's type only actually turns into the appropriate Fin n if the number is in range23/03 06:07
copumpkinI see23/03 06:07
copumpkinthat True business is clever but kind of ugly too23/03 06:07
nappingI've written some things like that myself, but it doesn't always work23/03 06:07
nappingI believe the projection through bool is unecessary23/03 06:08
copumpkinit "squeezes" it so that agda can infer the proof if one is available and trivially computable, iirc23/03 06:09
jmcarthuri wish i had a better idea of how agda's inference engine works23/03 06:10
jmcarthuri imagine it's very complicated23/03 06:10
nappingI think it's mostly higher-order matching?23/03 06:10
nappingIs there any good way to handle a lot of hidden parameters?23/03 06:10
jmcarthurit's not always clear to me what it can and can't infer by itself23/03 06:11
copumpkinusually if it's related to a function in some way, it can't handle it23/03 06:12
copumpkinunless it's just a type that's unified with a function's type23/03 06:12
copumpkinbut if it's actually obtained by applying a function, it doesn't know what to do (understandably)23/03 06:12
copumpkinalso, if irrelevance is thrown in, it can't infer it :P23/03 06:13
copumpkinno matter what it is23/03 06:13
jmcarthuryeah, i've been pretty good at *guessing* what it can do, so far23/03 06:13
jmcarthurbut i'd feel better if i understood it23/03 06:13
nappingdo you mean it would have trouble finding the argument type for T23/03 06:16
nappingif it was more like T (yes _) = \top ; T (no _) = \bot?23/03 06:16
nappingI think I see how it goes - if the N≤? gives a nice result, True reduces to \top, and it's inferred that the hidden argument must be tt23/03 06:17
joe6i think the "learn you an agda" should be posted to the topic. It is a very good starting point for the working class programmer.23/03 06:36
nappingWhy is it useful for a "working class programmer"?23/03 06:39
joe6it is easier to understand?23/03 06:42
joe6ddo not need understand mathematical notation..23/03 06:42
nappingI mean, what do you (or imagined readers) want to get from learning Agda?23/03 06:43
joe6formal verification vs unit testing, is a start. formal verification seems so much more powerful..23/03 06:45
nappingI was thinking of a "how to use Agda for real work" tutorial, just learning it to see about logic and verification and stuff makes a little more sense23/03 06:45
nappingbut then, maybe I am not ambitious enough - someone works on a webserver https://github.com/larrytheliquid/Lemmachine23/03 06:46
joe6napping, i think at this point, I felt that anything about agda without mathematical notation would help...23/03 06:47
joe6napping, will check out the webserver st23/03 06:48
joe6uff23/03 06:48
nappingcopumpkin: I see your categories just parameterize by a ton of things as well23/03 07:02
copumpkinnapping: it's as flexible as I could imagine it23/03 07:02
copumpkin:)23/03 07:02
copumpkinI was dissatisfied with hardcoded propositional equality23/03 07:02
joe6napping, is it possible to write a parser in agda?23/03 07:02
copumpkinor hardcoded set-in-set, which was the other library I found that had hom setoids23/03 07:03
nappingI'm wondering if some of the stuff about "fibration" in Norman Ramsey's "Expressive Language of Signatures" might work better23/03 07:03
nappingIt seems to work very nicely at the module level23/03 07:03
nappingI'd wondered before if it might work for programming in the small, but at least in something like Haskell, functions are pretty much fully applied and have few free parameters, except for a few types23/03 07:04
nappingIn Agda, if you have tons of types hanging out it might make more sense23/03 07:04
nappingjoe6: sure. if you try hard enough, you can even get the error case to explain why there can't be any valid parses of the input string23/03 07:06
copumpkinit's like in conor's summer school talks23/03 07:07
joe6napping, can you suggest something to guide me to do that?23/03 07:07
copumpkinhe builds a typechecker and mentions writing one that returns either an annotated AST or a first badly typed term23/03 07:07
nappingcopumpkin: I was thinking some quantification over implicit parameters could be added automatically, and give them dotted names based on the argument whose type they are parameters for23/03 07:07
copumpkinnapping: oh, you mean as an improvement for agda, not my library?23/03 07:07
joe6napping, "how to use Agda for real work" tutorial --- do you have any material in that regard?23/03 07:07
joe6napping, do you have any agda notes that you use?23/03 07:08
nappingmostly this stuff http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.Documentation23/03 07:09
nappingthe introductions and publications, but also the draft manual23/03 07:10
nappingAs for real work, I'm not sure it's possible (though I guess the Haskell bindings should help)23/03 07:10
nappingI don't think I've ever run an Agda program23/03 07:10
nappingI've been using it mostly for writing down proofs23/03 07:11
nappingcopumpkin: yes, a change to the language.23/03 07:12
nappinghmm, it seems most of your indices are just levels23/03 07:13
copumpkinyeah :P23/03 07:13
copumpkinannoying as hell23/03 07:13
copumpkinI get three per category23/03 07:13
copumpkinso things like horizontal composition associativity on natural transformations have 12 levels23/03 07:13
nappingwhy do you make a private module before opening it?23/03 07:14
joe6anyone written a running program with agda? not just proofs?23/03 07:14
nappingI see your Functors are parameterized by the categories23/03 07:14
copumpkinnapping: otherwise it makes me need to hide the Fs and the Gs inside other things later23/03 07:14
nappingIf they were fields instead, do you know how you could get them to agree for composition?23/03 07:14
copumpkinwhen I open a module I get all the non-private modules inside it23/03 07:14
copumpkinnapping: propositional equality23/03 07:14
copumpkinugly as hell23/03 07:15
nappingEven if I have that, it seems I need to explicitly repeat the extracted field components as with-parameters, to get them someplace where I can rewrite with the equality23/03 07:15
copumpkinnapping: but yeah, my module structure is horrible right now. When I get some time I'm reorganizing the whole thing23/03 07:15
copumpkinah yeah23/03 07:16
copumpkinyou'll typically need to "prove" your types23/03 07:16
copumpkinand then prove their values23/03 07:16
nappinghaven't found a way to rewrite the entire record by the equality in a way that shows up after projecting out, or to open it and then somehow rewrite all the things in that context23/03 07:16
copumpkinwhich is why I wanted to avoid stuff like that23/03 07:16
copumpkinbut yeah, deciding what to put in fields and what in parameters is a bit arbitrary23/03 07:17
copumpkinbut some combinations feel a lot more "right" than others23/03 07:17
nappingMy idea is to automatically insert some implicit parameters23/03 07:18
nappingfor your Category.Functor._≡_, the signature might be ∀ {C D : Category} → (F G : Functor C D) → Set (D.e ⊔ D.ℓ ⊔ C.ℓ ⊔ C.o)23/03 07:20
copumpkinoh I see23/03 07:21
copumpkinyeah, the forced quantification is a design decision23/03 07:21
copumpkinepigram doesn't force you to23/03 07:21
copumpkinI'd love to stop having to write levels everywhere23/03 07:21
nappingelaborated by realizing Category has implicit parameters e ℓ o and they were not provided for C's type (though how you know whether unification would go through, I'm not sure), and add the quanitfication with names C.e C.o, etc.23/03 07:21
napping(I don't see how Set (D.e ⊔ D.ℓ ⊔ C.ℓ ⊔ C.o)23/03 07:22
nappingis enough for the result level - why not both es and both os as well?)23/03 07:22
nappingEpigram doesn't require explicit qunatification, but it seems things must still be mentioned23/03 07:22
* copumpkin looks23/03 07:22
nappingYou have Grothendieck constructions? Reminds me of Spivak's database stuff23/03 07:23
copumpkinnapping: that's exactly why I made it :)23/03 07:23
copumpkinin fact, seeing his talk is what got me wanting to make this library in the first place23/03 07:23
nappingThat ACM article seems like so much handwaving23/03 07:23
copumpkinI haven't seen the article23/03 07:24
copumpkinjust saw his talk :P23/03 07:24
nappingthe bit on monads was interesting, but the rest verges on bullshit23/03 07:24
copumpkinand had an urge to see if I could write a usable library23/03 07:24
copumpkinspivak?23/03 07:24
nappingno, others23/03 07:24
copumpkinoh okay23/03 07:24
copumpkinI can see why == on functors doesn't need it23/03 07:25
copumpkine′ ⊔ ℓ′23/03 07:25
copumpkinthat's from the datatype above, on the other category23/03 07:25
copumpkinsince that lives in Set (ℓ ⊔ e)23/03 07:25
copumpkinℓ ⊔ o come from the fact that I quantify over objects in C and a morphism between them in C23/03 07:26
nappingIt's comparing SQL and coSQL (nee NoSQL). Among other things, it includes a table with delightful "dualities" beginning with the reasonable Children point to parents / Parents point to children, and ending with Query optimizer / Developer23/03 07:26
copumpkino.O23/03 07:26
copumpkinwait, this is supposedly formal23/03 07:26
copumpkin?23/03 07:26
copumpkindo you have a link?23/03 07:26
nappinghttp://queue.acm.org/detail.cfm?id=196129723/03 07:27
copumpkinoh, that thing23/03 07:27
nappingErik Meijer23/03 07:27
copumpkinI saw it on reddit recently but didn't read it23/03 07:27
nappingand early for April Fools23/03 07:27
napping*some* of it seems reasonably formal23/03 07:27
copumpkinlol23/03 07:27
copumpkinoh god23/03 07:29
copumpkin"Erik Meijer (emeijer@microsoft.com) has been working on "Democratizing the Cloud" for the past 15 years."23/03 07:29
dolioHe has?23/03 07:31
dolioShould Oracle be worried?23/03 07:31
dolioWow, the objection I read to that article was right: that table is awful.23/03 07:39
nappingwhich objection?23/03 07:50
doliohttp://www.reddit.com/r/compsci/comments/g8bzj/sql_and_nosql_are_really_just_two_sides_of_the/23/03 07:51
dolioThe big one there.23/03 07:51
dolioAnyhow, I don't believe that "strongly typed" is categorically dual to "potentially dynamically typed."23/03 07:53
dolioYou're going to need a lot of math to convince me of that.23/03 07:53
dolioOr that query optimizers are categorically dual to design patterns.23/03 07:53
nappingI want to see the commutative diagram for "Developer"23/03 07:54
dolioYeah.23/03 07:54
nappingI guess nobody there mentioned David Spivak23/03 07:55
copumpkinI really enjoyed his talk23/03 07:59
copumpkinI hear it's been given enough times that he's gotten quite good at it, and that it wasn't always this good23/03 07:59
nappingThe "Functorial Data Migration" paper is also interesting23/03 07:59
nappingMacLane said everything is a Kan extension - that seems to include joins, inserts, deletes23/03 08:00
nappingdid you see the talk in person?23/03 08:02
copumpkinyeah23/03 08:03
copumpkinhe came to the boston haskell meetup a couple of months ago23/03 08:03
nappingdolio: have you seen http://corp.galois.com/blog/2010/5/27/tech-talk-categories-are-databases.html23/03 08:09
dolioI've never gotten around to it.23/03 08:09
nappingIt's good23/03 08:09
copumpkinI heard that the galois version wasn't as good (in terms of presentation quality) as the more recent versions23/03 08:09
nappingI just read the slides23/03 08:10
copumpkinah23/03 08:11
copumpkinI think edwardk made a video of the boston version, but hasn't put it online yet23/03 08:11
nappingI was reading http://math.mit.edu/~dspivak/informatics/talks/ backwards anyway - that's actually the oldest listed talk23/03 08:11
nappingThe boston slides are more complete23/03 08:14
xplatwtf23/03 12:20
xplatmeijer : category theory :: chopra : quantum mechanics23/03 12:21
Saizanwhat does that mean?23/03 12:25
xplatmeijer doesn't understand category theory enough to use it correctly, but he understands it just enough that he can and does use it to make whatever he pulls out of his ass sound impressive enough that other people who can't use category theory will buy it :(23/03 12:41
xplatsimilarly to how deepak chopra uses quantum mechanics to sell his 'holistic' viewpoint23/03 12:43
xplatthis is in reference to "A co-Relational Model of Data for Large23/03 12:45
xplatShared Data Banks23/03 12:45
Saizani see :)23/03 12:58
xplati guess considering what the ACM charges for even minorly valuable articles one does well to be suspicious of things they give away for free23/03 13:00
stevanhi all. i'm a bit confused regarding what the syntax of a type theory with a universe a la tarski looks like. are Set, U, El and the codes all in the syntax? thanks.23/03 18:16
--- Day changed Thu Mar 24 2011
doliostevan: Ping.24/03 00:31
stevanpong24/03 00:36
dolioI can answer your question earlier.24/03 00:37
stevanplease do24/03 00:37
dolioSo, Set may not even be a type per-se.24/03 00:38
dolioIt may be a judgment.24/03 00:38
dolioLike '|- Nat set'24/03 00:39
dolioAsserting that Nat is a set.24/03 00:39
stevanif so, what is the type of the term: foo = El 'Nat, say?24/03 00:39
dolioHowever, you can also work it like '|- Nat : Set'.24/03 00:39
dolioBut, the important thing is that Set is sort of the entire domain of discourse. There's nothing above it.24/03 00:40
dolioAnything that is a type will be judged a set, but Set is not quite just another type.24/03 00:40
dolioThen, U is a set, just like Nat.24/03 00:41
dolioAnd its inhabitants are codes for all the 'small' sets.24/03 00:41
dolioAnd 'El s' is a set when s is an inhabitant of U.24/03 00:42
dolioSo, if 'Nat is the code for Nat, then El 'Nat is a set, and it's probably defined to compute to Nat.24/03 00:43
dolioDoes that make any sense?24/03 00:46
stevanhmm, you say El 'Nat is a set, but what type would foo = El 'Nat have?24/03 00:47
dolioInasmuch as you can write something like that, it'd also be judged a set.24/03 00:48
dolioHowever, types are somewhat less first-class in Martin-loef type theory than in Agda.24/03 00:48
dolioWhere'd I leave off?24/03 00:50
stevan01:48 < dolio> However, types are somewhat less first-class in Martin-loef type theory than in Agda.24/03 00:51
stevan01:50 < dolio> Where'd I leave off?24/03 00:51
dolioOkay.24/03 00:51
dolioSo, MLTT doesn't have a function space like T -> Set.24/03 00:51
dolioSo, like, 'El' on its own isn't valid, it's always got to be applied to something.24/03 00:52
dolioThat's why U is introduced, to write functions T -> U that result in (codes for) sets.24/03 00:53
dolioThen you use El to have them appear in types.24/03 00:53
dolioMartin-loef of course sometimes write stuff similar to 'foo = El 'Nat', but it's not a construct within the language, it's like a meta-theoretic alias for the right hand side.24/03 00:54
stevanso the second way: http://hpaste.org/44984/s  is the correct way to do it?24/03 00:59
dolioYes.24/03 01:00
stevanhttp://www.cse.chalmers.se/research/group/logic/book/book.pdf  on page 96 in the pdf it seems they are doing it the first way?24/03 01:02
dolioBook 96 or PDF 96?24/03 01:06
stevanbook 86, pdf 9624/03 01:07
dolioOkay, Is_zero(m) is the kind of definitional, meta-alias I was talking about.24/03 01:08
stevanok24/03 01:09
dolioIt isn't really a function Nat -> Set in the language. It's just a method of avoiding writing the complicated term more than once.24/03 01:09
dolioI should also note, there's other ways of presenting this stuff, too.24/03 01:12
dolioThere's what's called the logical framework.24/03 01:12
dolioIn that, you have a dependently typed meta calculus, where you define inhabitants of Set.24/03 01:13
dolioAnd there really are meta functions that abstract over or target Set.24/03 01:13
dolioAnd you go on to define your object language using the meta T -> Set as the object families of T-indexed sets.24/03 01:14
dolioSo then T -> Set is a well-defined meta-type, but not an object-type.24/03 01:15
dolioI don't *think* that's what this book is doing, but some of the early stuff is formatted that way.24/03 01:15
dolioLike when they write "Pi(A,B)".24/03 01:16
dolioInstead of (Pi x \in A)B(x)24/03 01:16
dolioOn 47/57.24/03 01:16
dolioMaybe that is what they're doing.24/03 01:17
stevanhmm24/03 01:17
dolioSome of this stuff looks quite like the logical framework presentation.24/03 01:18
dolioLike, if you have a meta f : (x : A) -> B x, then lam(b) : Pi(A, B).24/03 01:18
dolioEr, lam(f).24/03 01:19
stevanthis LF stuff is still not clear, but the answer to the original question is, thanks.24/03 01:23
dolioThe LF stuff may not matter.24/03 01:23
dolioIt's sort of a way of making your meta-theory more rigorous.24/03 01:24
dolioI expect that once they specify the object language (which is the MLTT), they make it look like it isn't embedded in the LF.24/03 01:25
dolioIf they are actually defining it in the LF>24/03 01:25
dolioSo you can forget about the LF stuff, and just think about the object language as its own entity.24/03 01:25
dolioBut the LF stuff would give a more precise explanation of what the "meta-alias" thing I was talking about actually would be, for instance.24/03 01:26
dolioInstead of just hand-waving.24/03 01:27
stevanmm24/03 01:27
dolioAlso, what it means for B(x) to be a family of types.24/03 01:30
dolioIt means it's a meta function X -> Set.24/03 01:30
stevanhow does it work in HOL like languages?24/03 01:35
dolioNever used one.24/03 01:35
stevanisn't the object language there something lambda calculus like while the LF stuff is stronger?24/03 01:35
stevani guess what i'd like to know is how their proofs and propositions work, perhaps this isn't related...24/03 01:51
stevangetting late, i should go to bed. thanks again.24/03 01:52
dolioNo problem.24/03 01:52
joe6I got the latest agda source from the repo and have opened up a .lagda file with emacs24/03 04:21
joe6but, I notice that it does not have a context menu.24/03 04:21
joe6when i right-click, it seems to be selecting text.24/03 04:21
copumpkindoes C-c C-l do anything?24/03 04:22
joe6the file seems to load-up fine. and I get the syntax coloring.24/03 04:24
joe6but, the mouse right button seems to be linked to selecting text instead of showing an agda-context menu. But, I do see an agda menu in the menu bar.24/03 04:24
joe6copumpkin, Is that good enough? or does the context menu have something special24/03 04:25
copumpkinnot sure, never really use it myself24/03 04:25
joe6the middle-click button does take control to the definition.24/03 04:26
joe6copumpkin, what do you use?24/03 04:26
copumpkinjust the key combos24/03 04:26
nappingand referring to the mode help24/03 04:27
joe6oh, ok.24/03 04:27
nappingThe useful thing with the mouse is middle-click to go to the definition24/03 04:27
nappingor M-.24/03 04:27
joe6 http://sprunge.us/bJdW , this is the file that I am playing with.24/03 04:29
joe6the "show goals" does not show anything.24/03 04:29
joe6napping, ok, thanks.24/03 04:29
nappingYou need to be in a goal, or have goals24/03 04:29
nappingYou know, leave a ? and then C-c C-l24/03 04:30
joe6napping, thanks, it is doing something.24/03 04:32
joe6napping, will go back to the tutorial24/03 04:32
joe6i am using the videos on youtube by iainmcgin. Can you please let me know if there are better tutorials anywhere else?24/03 04:34
nappingHave you read any of the papers and slides from the wiki?24/03 04:50
joe6napping, i am doing that now. Thanks.24/03 05:08
joe6when I install agda from the repo, does it install the standard library too?24/03 05:46
joe6this library, I meant, http://wiki.portal.chalmers.se/agda/agda.php?n=Libraries.StandardLibrary24/03 05:47
joe6i have the agda executable in my path, but am not sure if the agda exe installation also installs the standard library.24/03 05:47
joe6please ignore it, it appears to install a standard library.24/03 05:49
joe6maybe not, there is no IO primitive in the .cabal/lib/Agda dir24/03 05:50
joe6is it "open import Function" as there does not seem to be a file called Data.Function?24/03 06:21
copumpkinyeah, stuff has moved around a bit24/03 06:21
joe6copumpkin, is something like this wrong? fromString = fromColist . toCostring24/03 06:24
joe6does the '.' need to be the unicode char?24/03 06:24
copumpkinyeah, its \o24/03 06:25
copumpkinoff to bed24/03 06:25
joe6copumpkin,one quick question, do you know how to get the compose char in vim?24/03 06:26
copumpkinC-u C-x = <paste symbol>24/03 06:27
copumpkinsomething like that, anyway24/03 06:27
joe6copumpkin, do you know why they are so insistent on unicode?24/03 06:27
joe6why not haskell-ish chars?24/03 06:27
copumpkincause it's pretty!24/03 06:27
copumpkin;)24/03 06:28
joe6how about convenience?24/03 06:28
joe6good night, thanks for your help..24/03 06:28
copumpkinthe unicode input method grows on you24/03 06:28
copumpkinno problem :) ciao24/03 06:28
nappingalso, M-x describe-char will tell you how to type them24/03 06:32
joe6copumpkin, hopefully, it will.24/03 06:32
joe6napping, are you talking about emacs?24/03 06:32
napping\r is easier to type than ->, for one24/03 06:32
nappingyeah24/03 06:32
nappingIt's probably not worth trying to use vim24/03 06:32
joe6napping, oh, really, that bad, huh..24/03 06:33
nappingyou miss out on a lot of things24/03 06:33
nappingshowing you the type of everything in scope at a ?24/03 06:33
nappingautomatically adding all the cases for a variable you want to split on24/03 06:34
nappingevaluating expressions24/03 06:34
nappingtyping all the unicode stuff easily, I guess24/03 06:34
joe6napping ,what is the unicode number for the compose char? sorry for the bother24/03 06:37
joe6I have the unicode page before me and it has so many symbols and many look similar.24/03 06:38
nappingI'm not on my usual system, but you can check in emacs24/03 06:47
nappingopen Function.agda from the standard library, and see which compose they use24/03 06:47
joe6napping, good idea, thanks a lot.24/03 06:50
joe6is the code flow: .agda -> .agdai -> .hs -> .o ?24/03 06:57
joe6for the library files, atleast..24/03 06:57
nappingI don't know about the last two24/03 07:04
nappingor if agdai is more of a typechecked interface file like .hi24/03 07:05
joe6napping, ok, thanks.24/03 07:08
joe6napping, I am trying a simple agda file:  http://sprunge.us/dPUI24/03 07:14
joe6and I get this error:  http://sprunge.us/bVHg24/03 07:14
joe6can I have just a data definition in the .agda file?24/03 07:15
joe6updated source file:  http://sprunge.us/QiDJ24/03 07:17
nappingyeah, you can define types24/03 07:19
nappingbut it's not called Nat24/03 07:19
nappingopen Data.Nat24/03 07:19
nappingit's \bn24/03 07:19
nappingat least in emacs24/03 07:19
Saizan24/03 07:20
joe6ok, thanks a lot.24/03 07:23
joe6is agda -I not any good? is it a working piece?24/03 14:29
joe6which is the preferred notation: data List (a : Set) -> Set where or data List (X : Set) -> Set where?24/03 14:30
joe6capitals or small-case letters for user defined types..24/03 14:31
nappingIt's just an argument either way24/03 14:32
nappingbut captials seem to be a bit more common if you are thinking of it as a type24/03 14:32
joe6napping, ok, thanks.24/03 14:36
joe6napping, agda does not seem to have a big learning curve when it comes to simple programs and I find the types more intuitive compared to haskell.24/03 15:58
joe6Is that expected?24/03 15:58
joe6or, am I just mucking around too simple programs.24/03 15:58
copumpkinthe types are more consistent24/03 16:01
jmcarthurjoe6: agda is pretty easy as long as you aren't trying to prove very complex properties (which you can't even do in haskell, so i wouldn't say is points against agda in comparison)24/03 16:08
joe6i can get this to compile: main = putStrLn (fromString ("Hello, "++" world!")), but not: main = putStrLn ∘ fromString ("Hello, "++" world!")24/03 16:20
joe6the spaces, I get it.24/03 16:21
joe6sorry about that.24/03 16:21
joe6even this does not compile: main = putStrLn ∘ fromString ("Hello, " ++ " world!")24/03 16:22
joe6so, I guess it is not the spaces.24/03 16:22
jmcarthurjoe6: you might need so say     main = (putStrLn ∘ fromString) ("Hello, " ++ " world!")24/03 16:23
jmcarthur*to say24/03 16:23
jmcarthurjoe6: yours means the same thing as   main = λ x -> putStrLn (fromString ("Hello, " ++ " world!") x)24/03 16:24
jmcarthurman i wish i had agda's input mode in weechat24/03 16:24
joe6jmcarthur, thanks.24/03 16:25
joe6jmcarthur, that helped. Thanks.24/03 16:27
djahandariejmcarthur, you could just not use Unicode :p24/03 16:36
jmcarthurbut i like unicode24/03 16:36
joe6djahandarie, is that an option? how is that possible? I tried that, but could not get the program to compile.24/03 16:46
jmcarthurthe standard library uses a lot of unicode, but agda itself doesn't require it24/03 16:48
jmcarthurunless, of course, you want to use the library24/03 16:48
djahandarieRight. Things like forall and \ don't need to be unicode, but the stdlib uses unicode a lot, and obviously those things need to be unicode24/03 16:50
djahandarie(Like ∘)24/03 16:50
djahandariePersonally I just don't use the standard lib. :p24/03 16:50
jmcarthurit convenient when you just can't be bothered to rewrite it :)24/03 16:51
xplatokay, i need to figure out how to get copumpkin's category library to build so i can prove something24/03 16:57
joe6djahandarie, what do you use if not the standard lib?24/03 16:57
djahandariejoe6, I just write whatever I need24/03 16:57
copumpkinxplat: just get the standard library out of your path24/03 16:57
copumpkinI conflict with it24/03 16:58
xplatcopumpkin: i'm getting parse errors24/03 16:58
joe6djahandarie, your own version? can you please put it on github or something. It might help people like us who do not want to use unicode.24/03 16:58
djahandariejoe6, it is not by any means complete or useful by itself. :p24/03 16:58
djahandarieI just create a module for each one of my projects and drop in what I need24/03 16:59
xplatwait, how do i get the library off the path?24/03 16:59
djahandariecopumpkin calls his "Support" usually I think24/03 16:59
xplati may as well try that first24/03 16:59
copumpkinxplat: you must've added it there to begin with24/03 16:59
xplati did not24/03 16:59
copumpkinhmm24/03 16:59
copumpkinthen you should have no trouble with it24/03 16:59
xplatmy agda version is 2.2.824/03 16:59
copumpkinjust try loading Everything.agda to make sure everything works24/03 16:59
djahandarieI bricked my Agda install months ago and it's caused me to stop doing Agda entirely. :P24/03 16:59
djahandarieI should fix that24/03 17:00
xplatin this line24/03 17:01
xplat  .∘-resp-≡ˡ : ∀ {A B C} {f h : Hom B C} {g : Hom A B} → f ≡ h → f ∘ g ≡ h ∘ g24/03 17:01
xplati get a parse error at the first :24/03 17:01
xplatthat's line 26 of Category.agda24/03 17:01
xplatcopumpkin: what version of agda are you using?24/03 17:03
xplatlast time i tried i was getting these parse errors pretty systematically when something in a record was marked irrelevant via its type signature24/03 17:05
xplatso i figure it's probably some kind of language version or default option skew24/03 17:05
joe6/home/j/dev/apps/haskell/agda/learn/mylist.agda:26,21-22  The type of a datatype must end in a sort. ℕ isn't a sort. when checking the definition of List24/03 17:09
joe6this is the file:  http://sprunge.us/iFFh24/03 17:09
joe6i am trying to define a list of natural numbers.24/03 17:09
dantenIf you are only interested in list of natural numbers you don't need any parameters at all24/03 17:10
dantendata NatList : Set where [] : List ; _,_ : Nat -> List -> List24/03 17:10
dantenerrhm NatList24/03 17:11
dantenor you can have List (A : Set) : Set where ... and later have NatList : Set ; NatList = List Nat24/03 17:11
joe6danten, ok, thanks.24/03 17:12
dantennp24/03 17:12
dantenxplat, it seems as if irrelevant declarations as .∘-resp-≡ˡ where added in 2.2.1024/03 17:17
xplathuh, i wonder why i ended up with such an old agda24/03 17:19
xplatah, it must have been the newest on hackage last time i ran cabal update ...24/03 17:23
danten2.2.10 got released on 20 feb24/03 17:24
joe6isn't it 2.2.11 now?24/03 17:24
joe6or, is it the unstable version and should i be sticking with the stable version?24/03 17:25
dantenyeah odd numbers are darcs-version24/03 17:26
joe6danten, is it ok to use the darcs version, or, is it pretty bad?24/03 17:35
joe6I notice that ghc with the odd version gives a lot of issues (complains a lot more)24/03 17:35
joe6and, the stable version is a lot easy to use (in terms of module installation, etc.)24/03 17:36
joe6i figure that agda must be changing so much, that I am better off being on the bleeding-edge version.24/03 17:37
dantenI think it is better to just use the stable version, darcs changes stuff24/03 17:37
Saizanthe darcs version is generally quite stable24/03 17:37
dantenwell, depends on what you want todo24/03 17:37
Saizanthough of course you're more likely to find bugs, including those that make it inconsistent :)24/03 17:38
joe6ok, will switch to the stable version then.24/03 17:40
* xplat starts building Everything.agda again, it hasn't said anything yet which seems like a good sign24/03 17:40
joe6this file coredumps,  http://sprunge.us/VUEg, maybe because of the unstable version.24/03 17:40
joe6though the term evaluates fine in emacs.24/03 17:40
joe6the compiled file coredumps, I mean.24/03 17:41
joe6what is the haskell $ char for agda?24/03 17:41
joe6in the standard library..24/03 17:41
dantenhttp://www.cse.chalmers.se/~nad/listings/lib-0.5/Function.html#148024/03 17:44
xplat_∘_ has a primed version which is the same thing but non-dependent?24/03 17:58
xplatwhen does that turn out to be useful?24/03 17:59
xplat(i'm sure it must, but i can't see why as yet)24/03 18:00
dantenhmm, I think it can be for the infering the implicit arguments, but I may be wrong24/03 18:04
joe6this agda file coredumps,  http://sprunge.us/iQDM . Is there an #agda-dev to notify..?24/03 18:17
dantenthere exists a bug tracker24/03 18:18
djahandarieWhat in the world would the point of #agda-dev when #agda has 40 people in it? :p24/03 18:18
djahandarienad reads the logs of this channel I think. Best bet is to send something to the mailing list if you want it to be seen24/03 18:19
djahandarieIf you are sending a bug report, make sure to be on the latest darcs version because the issue may already be fixed24/03 18:20
joe6djahandarie, I tried both the lib-0.5 version and the darcs version. Both failed. Whereas, for the agda executable itself, I am on the darcs version.24/03 18:22
joe6Should I be on the stable version instead? for the agda exe too?24/03 18:23
djahandarieYou should be matching your versions across the board, mixing things sounds like it could cause problems24/03 18:23
joe6agda --version = Agda version 2.2.1024/03 18:23
joe6djahandarie, ok, will rollback agda to the cabal install version then.24/03 18:24
joe6djahandarie, these are the versions I have:  http://sprunge.us/EaCL24/03 18:27
joe6is there a problem with using hotmail to send emails to the agda mailinglist? I noticed that just the source file (which was an attachment) went through. But, none of my comments were in the mailing list archives..24/03 19:23
djahandarieI got your emails.24/03 19:23
djahandarieTwo of them actually...24/03 19:24
joe6djahandarie, but there does not seem to be any text(body) in them (atleast in the archives). Do you notice the issue too?24/03 19:31
joe6btw, I have narrowed it down to the use of "show 0" --  open import Data.Nat.Show using (show) , this is causing the core dump.24/03 19:32
djahandarieI see text.24/03 19:33
joe6ok, cool. sorry about that.24/03 19:34
joe6main = (putStrLn ∘ fromString) (show 0) -- coredumps24/03 19:34
joe6main = (putStrLn ∘ fromString) ("0") -- does not coredump24/03 19:34
djahandarieI'm not familiar with this part of Agda24/03 19:35
joe6though C-c C-n in emacs on main, shows the output for both commands.24/03 19:35
joe6djahandarie, will send it to the mailing list, then..24/03 19:41
djahandariejoe6, your emails seem to be sending twice24/03 19:45
joe6djahandarie, ok, thanks. will check..24/03 19:48
joe6quick question, this function [_] builds a list of one element and C-c C-d on [ 1 ] = List N, how is [ 1 , 2 , 3 ] represented to get List N?24/03 22:02
joe6just a simple list of 3 elements24/03 22:02
joe6i could do 1 , 2 , [ 3 ] , where "," is defined as the cons operator.24/03 22:04
joe6but, just curious on how I can represent a list as the haskell list [1,2,3]24/03 22:05
benmachinejoe6: something silly like _] being cons-onto-nil and [ being the identity function?24/03 22:07
joe6benmachine, I am looking for something simple, nothing fancy, something to test the list operators such a sum from the emacs command line24/03 22:09
joe6in ghci, i would normally do > sum $ [1..3]24/03 22:09
joe6to test sum.24/03 22:09
joe6benmachine, I am just curious if there is something similar here.24/03 22:10
joe6benmachine, I can get sum $ 1 , [ 2 ] to work, but not sum $ 1 , 2 , [ 3 ]24/03 22:10
joe6benmachine, so I figure there has to be a different way of doing that24/03 22:10
benmachine1 , 2 , [ 3 ] doesn't work?24/03 22:11
benmachinehave you told , to be infixr?24/03 22:11
kosmikusjoe6: if it's just about the functionality, not about the syntax, you can use Data.List.downFrom24/03 22:15
joe6benmachine, _,_ : (x : ℕ) (xs : List ℕ) → List ℕ ; _,_ = _∷_24/03 22:15
joe6open import Data.List         using (List; []; _∷_; [_])24/03 22:15
benmachinewhat's the default fixity?24/03 22:15
joe6benmachine, I tried 1 , $ 2 , [ 4 ] , but that does not work either.24/03 22:16
benmachinejoe6: that would be weird24/03 22:16
benmachinetry 1 , (2 , [ 4 ])24/03 22:16
joe6from Data/List.agda: infixr 5 _∷_ _++_24/03 22:17
benmachineoh right24/03 22:17
benmachinetry infixr 5 _,_24/03 22:17
joe6benmachine, that worked. thanks.24/03 22:17
joe6benmachine, I mean this: 1 , (2 , [ 4 ])24/03 22:18
benmachinejoe6: oh ok, try the fixity thing24/03 22:18
joe6benmachine, setting the infixr 5 _,_ worked.24/03 22:18
benmachinecool24/03 22:19
joe6benmachine, let me google what infixr does.24/03 22:19
joe6benmachine, thanks for your help.24/03 22:19
joe6kosmikus, will check out the downFrom.24/03 22:19
dolioThere's no enumFromTo?24/03 22:20
--- Day changed Fri Mar 25 2011
copumpkinxplat: did you get the CT library to build?25/03 00:09
djahandariejoe6, looks like you actually found a bug :)25/03 00:33
copumpkinsadly not a very uncommon occurrence around here :)25/03 00:34
djahandarieI thought Haskell was suppose to create bug-free software ;)25/03 00:34
djahandarieThey lied to me!25/03 00:34
xplatcopumpkin: it built nicely once i upgraded to 2.2.1025/03 00:38
copumpkincool25/03 00:38
joe6djahandarie, cool. do you know if it is hard to fix?25/03 01:43
djahandariejoe6, I have no idea. The guy who replied to your email is the one who can fix it though :p25/03 01:54
joe6djahandarie, ok, thanks. will check my email.25/03 02:19
joe6"The power of pi" is very helpful to me in trying to learn agda. Just wanted to check if it is stil relevant to the agda of today?25/03 02:29
dolioIt should be mostly.25/03 02:30
dolioIt's conceivable that some code has been broken.25/03 02:30
joe6dolio, thanks.25/03 02:30
joe6i was trying to understand how the haskell typeclasses carry over to agda and that paper nailed it25/03 02:31
jlouisCan the interactive emacs mode expand 'with' statements?25/03 10:42
jlouisMy brain says yes, but I can't remember how to do it25/03 10:42
jlouisfoo x y with x \equiv y <C-c C-c> doesn't help25/03 10:43
Saizani do:25/03 10:46
Saizanfoo x y with x \equiv y25/03 10:46
Saizan... | z = ?25/03 10:46
jlouisah, yes!25/03 10:47
jlouisthank you25/03 10:47
Saizannp25/03 10:47
jlouisI am trying to define a simple memory/store for a programming language, but the first property fails: https://gist.github.com/6d26d932799c36342050 How do you reason that the case is absurd from computation?25/03 11:29
jlouisI have a coq proof of it, so I am inclined to think it can be done :)25/03 11:30
jlouisoh25/03 11:30
jlouisnah25/03 11:30
Saizan\bot-elim (\negp refl) ?25/03 11:31
jlouiswhere is \bot-elim defined?25/03 11:32
jlouisAgdahoogle is sorely missing :P25/03 11:32
SaizanData.Empty25/03 11:33
jlouisah, thank you25/03 11:33
SaizanAgdahoogle would be nice indeed :)25/03 11:34
jlouisI see how it is done now.25/03 11:34
jlouis\negp refl provides us with the bot we need and then we can eliminate by bottom25/03 11:34
Saizanyep25/03 11:35
Saizan\bot-elim would read better as "absurd"25/03 11:37
jlouisRight, it is often defined as 'void' in Twelf25/03 11:38
jlouisehm, bot is25/03 11:38
jlouisthe uninhabited type25/03 11:38
jlouisso you can derive Whatever fro it25/03 11:38
xplati sometimes read \bot as 'pigs fly', just for fun25/03 11:47
jlouisok, here is another coq-ism I need some help with. In coq, if we have the equivalent of (x   : just .v1 ≡ just .v2) we can use injection to derive (Goal: .v1 ≡ .v2).25/03 11:47
jlouiswhat do you do in Agda for that kind of stuff in general?25/03 11:48
jlouisin general, if (C x === C y) for a constructor C, then (x === y) in Coq. I imagine it is also true in Agda25/03 11:49
Saizanyes, it is25/03 11:51
jlouisI wonder what the constructor-stripper method is then25/03 11:51
Saizanone tends to pattern match on x25/03 11:52
Saizanwhere that's inconvenient you've to define a lemma for that specific constructor25/03 11:52
jlouisok25/03 11:52
jlouisWorked like a charm. Naturally it is solvable by computation.25/03 11:54
jlouisIs the dependent match with | Mckinna/McBrides work? It surely beats Coqs dependent match IMO25/03 11:59
Saizani think so, "The view from the left" has the "with" gadget25/03 12:01
benmachine11:37:25 < Saizan> \bot-elim would read better as "absurd" <-- I think it should be called "explosion"25/03 12:07
benmachinejust for fun25/03 12:07
xplat(_when-pigs-fly : Set -> Set ; i'll-be-a-monkey's-uncle when-pigs-fly = _|_ -> i'll-be-a-monkey's-uncle ; sure-why-not : \forall a -> a when-pigs-fly )25/03 12:25
nappingHow can the emacs mode recognize a literate agda file?25/03 13:23
napping"You tried to load /home/brandon/test.lagda which defines the module25/03 13:23
nappingtest. However, according to the include path this module should be25/03 13:23
nappingdefined in /home/brandon/test.agda."25/03 13:23
nappingWell, I guess if it's a pain to actually load and use a literate agda file, maybe I shouldn't bother formatting my email like that25/03 13:24
copumpkinfix agda, then format your email like that! :)25/03 13:27
nappingI notice \r is actually easier to type than ->25/03 13:28
nappingI have a few more fixes for adga I'd like to make25/03 13:28
nappingAh, I guess it was just having a preexisting test.agda (open in emacs, even) that was confusing it25/03 13:30
nappingI think I have a solution to the record casting problem25/03 13:34
nappingor at least something close25/03 13:34
nappingMessage sent25/03 13:35
nappingcopumpkin: a record must be parameterized by levels?25/03 13:35
nappingI guess it would be a bit hard to say what the final level should be if they could be fields25/03 13:36
jlouisCan I get extensionality in any way?25/03 13:46
dolioYou can postulate it.25/03 13:46
Saizani.e. with the postulate keyword25/03 13:47
jlouisthat is like adding an Axiom for it?25/03 13:47
Saizanyep25/03 13:47
* jlouis nods25/03 13:47
nappingif you want to ban it, is grepping for postulate enough?25/03 13:51
Saizanshould be25/03 13:57
joe6quick question, in haskell ghci, I used to use (undefined::MyType) quite a bit while testing some function whose parameter is MyType. Is there such a functionality in agda?25/03 14:00
napping?25/03 14:00
nappingor _25/03 14:00
joe6when I do C-c C-n,25/03 14:00
joe6napping, thanks.25/03 14:01
nappingYou can leave a hole as the implementation25/03 14:01
joe6napping, that worked. Thanks..25/03 14:01
nappingI'm not sure how well that works as an argument25/03 14:01
nappingpostulating something might work better for that25/03 14:02
joe6something like this does not seem to work:  append (Int : Set) (Cons _ Nil) (Cons _ _ Nil)25/03 14:03
joe6append : (Int : Set) → List Int → List Int → List Int25/03 14:04
joe6from C-c C-n, I mean. Though, it recognises (Cons _ Nil) as List25/03 14:04
joe6append Int Nil ys = ys; append Int (Cons x xs) ys    = append Int xs (Cons x ys)25/03 14:07
joe6though, my implementation is still wrong and I am working on it..25/03 14:08
joe6of append, i mean.25/03 14:09
Saizannapping: your CastFun reminded me of this paper http://citeseerx.ist.psu.edu/viewdoc/summary?doi= 14:09
joe6append Int (Cons x xs) ys    = Cons x $ append Int xs ys25/03 14:10
joe6better..25/03 14:10
nappingThat looks like it might be nice25/03 14:14
nappingI don't know how well a casting module will work for deeper structures25/03 14:23
nappingThe stuff about manifest versions of types might at least be implementable25/03 14:57
Saizanyeah25/03 14:58
Saizanthe one about coercive subtyping is a bit handwavy25/03 14:58
nappingI'm more worried about the sharing annotations - I don't see how to get that to compute at all25/03 14:59
joe6a vector is defined as: data Vec (A : Set) : Nat → Set where..., just curious on why it is not: data Vec (A : Set) (Nat :Set) : Set where..25/03 15:06
Saizanthose two are quite unrelated25/03 15:07
Saizansince Nat in the second is just a variable name25/03 15:07
Saizanyou'd want data Vec (A : Set) (n : Nat) : Set where to parametrize by a Nat25/03 15:08
* djahandarie suspects that he meant (n : Nat)25/03 15:08
jmcarthurjoe6: you need to be able to vary the Nat parameter for each constructor25/03 15:08
joe6djahandarie, yes, that is what i meant.25/03 15:08
Saizanhowever if you had that you ..what jmcarthur said25/03 15:09
joe6i meant, data Vec (A : Set) (N : Nat) : Set where..25/03 15:09
jmcarthurjoe6: try it and see what happens :)25/03 15:09
joe6jmcarthur, gotcha.. then there would be as many constructors as N's25/03 15:10
jmcarthurnot sure that sentence makes sense to me25/03 15:11
Saizanthe only difference is that if you have data Vec (A : Set) (N : Nat) : Set where then each constructor has to have exactly "Vec A N" as return type25/03 15:11
Saizanit can't have e.g. Vec A zero25/03 15:11
jmcarthurjoe6: it would mean that you can't build a vector of length n+1 out of a vector of length n25/03 15:12
jmcarthurjoe6: it would also mean you can't force a vector to have length zero25/03 15:12
joe6Saizan, thanks, that makes sense..25/03 15:12
joe6zero : Nat -> Set25/03 15:12
Saizanin my example zero : Nat25/03 15:12
Saizanjmcarthur: that's not so true, since you could put arguments like (suc m == N) inside the constructor25/03 15:14
joe6Saizan, I am under the impression that all types should belong to the base type of Set, but in this case (data Vec (A : Set) : Nat → Set), it belongs to a type of Nat -> Set?25/03 15:17
SaizanVec A : Nat -> Set, yeah, so e.g. Vec A zero : Set, since zero : Nat25/03 15:18
Saizanit's like in haskell where [] :: * -> * instead of *25/03 15:19
Saizanexcept that there isn't only *25/03 15:19
Saizan* is roughly equivalent to Agda's Set25/03 15:19
djahandarieIs it possible to embed something like Constructive Validity in Agda?25/03 15:25
dolioWhat does that mean?25/03 15:28
djahandarieThat's a good question. :p25/03 15:28
djahandarieA computational implementation of it?25/03 15:28
djahandarieWhat does constructive validity correspond to? Martin-Lof type theory?25/03 15:28
dolioThat's what I was asking you.25/03 15:29
dolioAre you talking about that Awodey post on the homotopy blog?25/03 15:29
djahandarieOh damn, Awodey wrote this?25/03 15:30
djahandarieYes, I'm looking at somethat I wrote down when I read that25/03 15:30
djahandarie"Read" probably being overstating it. I should probably go do that before asking questions25/03 15:30
dolioJust using Agda as your 'logic' is essentially adhering to constructive validity.25/03 15:31
dolioThe only questionable bit is that it uses K.25/03 15:31
dolioBut, of course, his constructive validity included extensional type theory, which is typically laxer than Agda.25/03 15:32
dolioSo, constructive validity is simply using Agda's sigma for exists, pi for forall, product for and, disjoint union for or, etc.25/03 15:36
dolioAnd because of that, you can prove the theorem of choice in Agda.25/03 15:37
dolioBecause 'forall ... exists ...' carries enough stuff around to construct the function in the 'exists ... forall ...'.25/03 15:38
xplatis this basically the same as using agda without irrelevance?25/03 15:44
dolioNot using irrelevance would be important, I think, yes.25/03 15:45
djahandarieHow does using irrelevance change things?25/03 15:45
xplatdjahandarie: because you can't use irrelevant witnesses to properties to construct functions25/03 15:46
dolioWith irrelevance, I can conceivably (not actually implemented yet) make a sigma that doesn't carry around its first argument.25/03 15:46
jmcarthurSaizan: ah yes you are right, but that's a different way to design it25/03 15:46
xplat(or other values that you need not to be irrelevant)25/03 15:46
jmcarthuri was operating under the assumption that joe6 was wanting to stick with the same constructors as the usual definition25/03 15:47
joe6Saizan, thanks for your explanation.25/03 15:47
jmcarthurjoe6: my understanding of your experience recently was that you are very new to haskell. was i correct?25/03 15:48
jmcarthurjoe6: i'm curious how agda is working out for you given your experience25/03 15:48
jmcarthurassuming my understainding was correct25/03 15:48
jmcarthur*understanding25/03 15:48
dolioxplat: It might depend on how you make the irrelevance work, too.25/03 15:51
nappingThis record casting thing is stacking up so far25/03 15:51
nappingI was worried about universes, but a record in Set₁ can have fields whose types are in Set₁25/03 15:52
dolioIf you don't ignore irrelevant things for the purposes of equality, for instance, you could just ignore all the irrelevant annotations and produce an ordinary Agda program that would type check.25/03 15:52
nappingI think they are ignored, so that doesn't quite work25/03 15:53
dolioSo the irrelevance stuff would merely be an optimization.25/03 15:53
nappingDoes the Agda compiler eliminate any indices?25/03 15:53
nappingas in "Inductive Families Need Not Store Their Indices"?25/03 15:54
dolioDon't know.25/03 15:54
dolioChoice may actually still hold even with irrelevancies.25/03 15:55
dolioBecause you're producing an irrelevant function.25/03 15:57
Saizannapping: the wikipage of the last AIM mentioned the "forcing" optimization, iirc25/03 15:57
dolioMaybe you'd have to have squashed the relation, too. I'm not sure.25/03 15:58
dolioUnfortunately, I don't have a way to test this.25/03 15:59
dolioI should get around to implementing an interpreter with irrelevance.25/03 15:59
solisticI'd like to experiment with Agda, is there still a _supported_ way besides using emacs?25/03 16:00
Saizanthere's a standalone executable you can use to typecheck, but that's pretty crude25/03 16:06
joe6th mixfix operators are pretty cool..25/03 16:12
joe6jmcarthur, I was mucking around Haskell for more than a few years now. I thought the lack of variables was cool, for the first few years. Then, the use of higher order functions. But, the real enlightenment struck me when pastorn (of #haskell irc) showed me how to program using types in haskell. That just changed my perspective on programming. Since then, I have been trying to use the llvm modules and most of the type stuff felt more like ...25/03 16:16
joe6... type-hackery. Agda's type handling felt more intuitive, though I could hardly understand any terminology or notations.25/03 16:16
jmcarthurlack of variables? you mean lack of mutation?25/03 16:17
jmcarthuryes, i love how dependent types make you feel much more in control of the type system25/03 16:17
joe6I am just going by my gut-instinct on this one and *feel* that Agda will make my programs better.25/03 16:17
jmcarthurdespite my lack of experience with dependent types25/03 16:17
jmcarthuri have more experience simulating dependent types in haskell than i do using a real dependently typed language :\25/03 16:18
joe6the learning curve is there but nowhere close to how I felt when I started off on haskell. But, anyway, I think I will crack it.25/03 16:19
joe6discovering #haskell irc improved my haskell-fu a zillion times and I probably would never be where I am but for that irc.25/03 16:19
joe6anyway, i think the #agda irc has a lot lesser people but also more "eager to help" people..25/03 16:20
joe6but, again, given my "working class" programmer background, I do not understand much of the discussion that goes on in this irc.25/03 16:21
djahandarieI don't understand anything that goes on in this channel, even the stuff I'm talking about25/03 16:22
joe6let me put it this way, agda feels more natural than haskells' type system and I think it is the next step in the evolution..25/03 16:22
joe6jmcarthur, I mean variables as in a = b + c, kind of way.25/03 16:23
djahandarieBindings? Haskell certainly has those. :p25/03 16:23
jmcarthurjoe6: variables are just names that can be bound to different values later ;)25/03 16:24
joe6yes, so should be easy to piggy-back haskell and then maybe, haskell will incorporate agda at some point of evolution..25/03 16:24
joe6jmcarthur, I agree..25/03 16:24
jmcarthuri doubt that haskell will officially adopt dependent types25/03 16:24
jmcarthurjoe6: well, haskell has that notion of variable then25/03 16:24
jmcarthurit's imperative languages that have messed up the definition of "variable" to mean mutable variables25/03 16:25
joe6jmcarthur, if you consider bind or, maybe, I should say the notion of "pure" functions, then....25/03 16:26
djahandariejmcarthur, I think the type/kind system is slowly becoming dependently typed, fwiw...25/03 16:26
joe6jmcarthur,  yes, I agree... anyway, "purity" got me by the b..ls25/03 16:26
joe6and then the rest of haskell just possessed me..25/03 16:27
djahandarieI think byorgey's typekind thing actually does make it dependently typed (sans the value level)25/03 16:27
djahandarieOh hey, byorgey is here himself. He should comment ;)25/03 16:27
jmcarthurdjahandarie: depending on how tight your definition is, haskell may already be powerful enough to be equivalent to dependent types25/03 16:27
joe6djahandarie, most of haskell type extensions feel like hacks.25/03 16:27
djahandariejoe6, this one wouldn't be a hack, it would be totally rewriting the core and everything surrounding it :p25/03 16:28
joe6oh, ok.25/03 16:28
joe6but, then how about backward compatibility?25/03 16:28
jmcarthurjoe6: kind of in the same way that moving mainstream languages in the direction of functional programming is hackish, yes25/03 16:28
jmcarthurit's adding features to a language (and its existing libraries) which was not designed with those features in mind from the beginning25/03 16:29
djahandariejoe6, shouldn't cause any problems.25/03 16:29
joe6jmcarthur, i agree, that is the reason the lisp with haskell bind did not attract me.25/03 16:29
joe6jmcarthur, haskells' rigidity is needed to get off the training wheels.25/03 16:29
Saizandjahandarie: they'd have to change System Fc again?25/03 16:30
xplatcan you both rename and hide identifiers when doing an open import?25/03 16:30
joe6anyway, back to my learning...25/03 16:30
djahandarieSaizan, huh? Change it?25/03 16:31
djahandarieIsn't that just a paper?25/03 16:31
joe6btw, i am not sure if ulf is on this channel, but, pastorn was a student of his..25/03 16:31
Saizanwell, let's say GHC's Core language25/03 16:31
djahandarieThey made type coercions a seperate type, then merged the type and kind levels25/03 16:32
djahandarieI think those were the only changes to core25/03 16:32
djahandarieMainly so whatever ADT you define on the type/value level can automatically be lifted25/03 16:33
Saizanxplat: try changing the order of the clauses25/03 16:33
xplataha, seems to be working25/03 16:33
xplatit's a little odd that the order matters25/03 16:34
Saizanyeah, never managed to ask why25/03 16:35
joe6jmcarthur, how did you get into agda?25/03 16:38
joe6are you affiliated to chalmers?25/03 16:38
joe6solistic, I think you can use agda -I (interpreter mode), but I read somewhere that it is not actively maintained.25/03 16:40
jmcarthurjoe6: i'm just a programming language theory enthusiast25/03 16:41
djahandarieMe too!25/03 16:41
* djahandarie enthuses25/03 16:41
joe6it appears that it is more like a *passion* than *enthusiasm*, given the many times I see you on the irc.25/03 16:42
jmcarthuri just leave my client on all the time25/03 16:42
djahandarieMe too!25/03 16:42
nappingcodolio: hey, you replied to Harper. Do you know much about induction?25/03 17:01
xplatcopumpkin: where would i find a cong for a Category's _≡_?25/03 17:04
nappingprobably close to where it is defined25/03 17:05
copumpkinxplat: you mean the hom equality?25/03 17:07
copumpkinI don't think you get that in general25/03 17:07
copumpkinthere's the proof that composition respects equality25/03 17:07
copumpkino-resp-==25/03 17:08
copumpkinworst name ever25/03 17:08
nappingYou can't expect it in general, if you are just proving things25/03 17:08
copumpkinI mean, you only really get cong for propositional equality25/03 17:08
copumpkinsame with subst25/03 17:08
xplathm, good point ...25/03 17:08
nappingbut if you have a particular category with a particular choice of equality, you can see where that equality comes from25/03 17:09
copumpkinbut everywhere I've wanted it, the respect proof is good25/03 17:09
nappingoh, I guess so25/03 17:09
nappingwell, for _≅_ as well25/03 17:09
copumpkinxplat: what do you need it for?25/03 17:09
nappingIt turns out the wrapping modules are much like Σ over the parameters25/03 17:10
nappingand mostly what I want to do with the cast is really get out and open the indexed version, so a simple function works fine for that25/03 17:11
joe6every agda function  takes the type of its' parameters an argument (explicit argument or implicit argument)?25/03 17:12
copumpkinyeah25/03 17:12
copumpkinsame with haskell, but haskell makes it a different kind of function25/03 17:12
solisticjoe6: yes, it outputs "The interactive mode is no longer supported. Don't complain if it doesn't work." ...25/03 17:12
joe6solistic, but, it works to a certain extent inspite of the message.25/03 17:13
solisticjoe6: ah, ok, good to know25/03 17:13
joe6solistic, I read somewhere to ignore the message and use it, but not to complain if it does not work.25/03 17:14
joe6copumpkin, ok, thanks.25/03 17:14
joe6_++_ : forall {A m n} → Vec A m -> Vec A n -> Vec A (m + n) -- in this function definition, what is the need for "forall"? Why is it not abstracted away?25/03 17:15
copumpkinforall tells it to infer25/03 17:15
copumpkinyou can drop it if you want to say what types A, m, and n have25/03 17:15
joe6oh, ok. that helps. thanks.25/03 17:15
xplatand now i'm having trouble with 'where' clauses ... i wish there were as nice a reference for agda as the haskell98 report ...25/03 17:17
joe6i think there was an agda reference.25/03 17:18
joe6i saw a link to that in the mailing list25/03 17:18
xplatyeah, but it's not as complete or well-organized25/03 17:18
joe6one of the mails in the mailing-list archive.25/03 17:18
joe6xplat, oh, ok, good to know.25/03 17:18
Saizanwhat trouble are you having with where?25/03 17:19
xplati'm trying to locally open a module and i get a parse error at 'open' seemingly regardless of how i scope it, despite it being done similarly elsewhere in the same file ...25/03 17:24
codolioxplat: Can you paste how you're trying to do it?25/03 17:27
xplatid⊗x = record\n  { <stuff>\n  ;F-resp-≡ = λ F≡G → ?\n    where\n      open SetoidReasoning hom-setoid\n  }\n25/03 17:35
solisticjoe6: Do you know what to pass to agda with -i to find the standard lib?25/03 17:35
xplatalso tried with parens around the lambda25/03 17:35
xplatand a few other ways25/03 17:35
Saizanthe where should go outside the closing } of the record25/03 17:35
Saizanit can't attach to F-resp-≡, like in haskell25/03 17:36
Saizanno idea why it's like that even in haskell though.25/03 17:36
xplatsee, that's what confuses me since it says where can attach to any expression in the manual ...25/03 17:37
joe6solistic, i do agda -I -i ../install/lib-0.5/src -i .25/03 17:37
Saizanmight be outdated25/03 17:37
joe6where the standard lib is at ../install/lib-0.5/src25/03 17:38
solisticjoe6: ok, I just dowloaded it25/03 17:38
joe6solistic, i presume that you have standard lib?25/03 17:38
solisticjoe6: it is not installed with `cabal install agda`, right?25/03 17:38
joe6nope..25/03 17:38
joe6solistic, i am not an expert but I did not see it installed with cabal install agda25/03 17:39
joe6solistic, what are you using to learn agda?25/03 17:42
joe6solistic, just trying it out?25/03 17:42
solisticsolistic: yes25/03 17:44
joe6solistic, check out the "power of pi", it is helping me in my learning process..25/03 17:46
joe6word : Int -> Set -- when I have a function definition as this, does it mean that the function word is creating a new a type?25/03 17:47
joe6s/new a type/new type/25/03 17:47
joe6or, maybe, I should say *returning* a type25/03 17:48
jmcarthurWord 32   would be a type25/03 17:48
joe6jmcarthur, got it, thanks..25/03 17:48
byorgeyjoe6: it's not creating a new type, just mapping Ints to types.25/03 17:57
joe6byorgey, ok, thanks.25/03 17:59
joe6just curious, do agda programs become hard to understand, with the intermixing of types and values?25/03 18:00
dolioI don't think so.25/03 18:00
jmcarthuri've not found that to be the case so far25/03 18:01
jmcarthurthe hardest thing to me is satisfying proof obligations25/03 18:01
dolioThey tend to be easier to understand than the equivalent encodings in stuff like Haskell.25/03 18:02
jmcarthuryes25/03 18:02
jmcarthurbut also more common25/03 18:02
jmcarthurprobably due to being easier to understand though25/03 18:02
dolioI meant programs in general.25/03 18:03
solisticjoe6: I just started with "Dependently Typed Programming in Agda25/03 18:03
joe6ok, thanks.25/03 18:04
solisticjoe6: but I'll have al look on the other paper, thx for the hint25/03 18:04
dolioHacking around in Haskell's type system tends to be uglier and harder to deal with than what you do in Agda.25/03 18:04
joe6solistic, i got lost once they start explaining the type theory.25/03 18:04
solisticjoe6: ok, I'm warned ;)25/03 18:05
djahandariedolio, even the really odd stuff in Haskell still has a giant wiki article or two written about it25/03 18:12
djahandarieIn Agda sometimes you need to search for pdfs or mailing list entries25/03 18:12
djahandarieI really like Harper's blog25/03 18:42
joe6djahandarie, what is the url?25/03 18:46
djahandariehttp://existentialtype.wordpress.com/ He started it fairly recently25/03 18:46
xplatis there some way in agda-mode to find out the type of an expression if it were to be evaluated in a certain scope?25/03 19:18
xplatfor example, inside a goal25/03 19:19
copumpkinC-c C-d25/03 19:26
copumpkinin the goal25/03 19:26
copumpkinin the hole, rather25/03 19:27
xplatwhy is refl from C.equiv showing up at such a weird type?25/03 19:31
copumpkin?25/03 19:31
xplathold on, pasting.  this would be quicker if agda didn't keep pushing firefox into swap ...25/03 19:33
copumpkinyeah :/25/03 19:33
xplathttp://hpaste.org/45043/monoidal_category_refl_fail25/03 19:36
copumpkinwhich part fails?25/03 19:37
xplatnow annotated25/03 19:41
copumpkinwhoa, you're not using emacs?25/03 19:41
xplat... i'm not?25/03 19:41
copumpkinoh maybe25/03 19:41
copumpkinthe error format just looked weird25/03 19:41
xplati just trimmed off the directory prefix of where i'm keeping the library25/03 19:42
xplatso it probably looked weird from the short first line and missing '/'25/03 19:42
xplater, 'goal type in the hole' came out wrong25/03 19:43
xplatit's actually Category._≡_ C (Category._∘_ C g f) (Category._∘_ C g f)25/03 19:44
copumpkinokay, and refl doesn't fit?25/03 19:45
xplatyeah, for some reason refl is coming out as Category._≡_ C (_433 C ⊗ id) (_433 C ⊗ id)25/03 19:46
copumpkinare you using the right refl?25/03 19:46
copumpkintry IsEquivalence.refl C.equiv25/03 19:46
copumpkinI actually made some changes to the repo25/03 19:47
xplati have a 'where open IsEquivalence C.equiv renaming (refl to C-refl)' in scope there and i'm using C-refl25/03 19:48
xplatrefl alone is ambiguous anyway25/03 19:48
copumpkinhmm25/03 19:48
copumpkinjust a sec25/03 19:48
xplatwow, this latest change is sure taking its time compiling25/03 19:55
copumpkinlol25/03 19:55
copumpkinyeah, this shit takes forever25/03 19:55
copumpkinI sometimes comment out everything but the thing I'm working on (and its dependencies) in the given file25/03 19:55
xplatthe next gen agda compiler needs to be thoroughly incremental with an lru cache of fragments25/03 19:56
xplator some other way of being faster if that doesn't work25/03 19:57
copumpkinyeah :P25/03 19:57
copumpkincoq is a lot smarter about it I think25/03 19:57
xplati wonder which parts of compiling are slowest25/03 19:57
xplattypechecking would normally be the obvious candidate, but i wonder about that here25/03 19:58
xplatspecifying the intermediate equality expression as ⊗₁ (C.id ∘ C.id , g ∘ f) made the compile take 6 minutes, but the error is the same25/03 20:02
copumpkinI'd rename C to something else to make sure you're getting the right one25/03 20:02
copumpkinit looks like it's grabbing the x*id one25/03 20:03
xplatIsEquivalence.refl C.equiv worked ...25/03 20:03
copumpkinoh25/03 20:03
xplatthat's just bizarre25/03 20:03
copumpkinyeah :/25/03 20:03
copumpkinif it weren't so slow, it'd be easier to fool around with it25/03 20:06
xplatoh, i figured it out25/03 20:07
copumpkinwhat was it?25/03 20:07
xplatit probably infers the type of the opened C.equiv from the use of sym too specifically and tries to use the same overly-specific type for the refl25/03 20:08
copumpkinoh, yes!25/03 20:08
copumpkingood point25/03 20:08
xplatwell, maybe it has to be that specific25/03 20:08
copumpkinyeah, it does25/03 20:09
copumpkinthat happens a lot with the setoid reasoning25/03 20:09
copumpkinsometimes being consistent about where you put the sym (on the inside or outside) helps, but I don't think it would here25/03 20:09
xplati guess with that kind of implicit-explicit polymorphism you wouldn't have it automatically lifting to an implicit lambda representing the MGU25/03 20:09
* xplat starts another reload25/03 20:15
xplatif i didn't screw anything up i should have finished both of those helper endofunctors25/03 20:15
copumpkinawesome25/03 20:15
copumpkinafter making the functors, stating the pentagon shouldn't be much work25/03 20:16
copumpkinthen actually constructing a monoidal category might be quite a pain :)25/03 20:16
copumpkinbut I guess we can see soon with products :)25/03 20:16
copumpkindescartes, here we come!25/03 20:17
xplatif you have a cartesian monoidal category, you should be able to get most of the other proofs for free just by proving your map on objects produces products25/03 20:19
xplat(you the user, unfortunately not you the library implementor :-7 )25/03 20:20
copumpkin:P25/03 20:20
xplatdid forget to flip one thing during copy-pasta, rebuilding again25/03 20:22
copumpkinouch25/03 20:22
xplat... AND ncatlab.org is timing out for me :(25/03 20:25
copumpkinsame here25/03 20:26
xplatstill building25/03 20:32
xplatat least by the time i can start putting in the pentagon law ncatlab will probably be up again ...25/03 20:33
xplatfinished25/03 20:43
xplatthe running agda is up to 1210M, 656M resident ...25/03 20:43
xplatif only i had a computer program that i could run to check my agda programs for correctness before i try to compile them ...25/03 20:50
jmcarthuro_O25/03 20:51
xplatwell if compiling them takes 15 minutes ...25/03 20:51
* jmcarthur watches his agda memory footprint grow and grow25/03 21:58
joe6from the paper "Power of Pi", the pattern LNil(unicode character for reverse L) means 'the value of this argument can only be equal to x'. The 2 unicode characters are not in the agda.vim file, either.25/03 23:17
copumpkinxplat: how goes it?25/03 23:17
joe6Any thoughts on if there are other characters that can be used in their place?25/03 23:17
joe6almost like a top-down \Gamma character.25/03 23:18
joe6let me try [ ] brackets instead?25/03 23:20
joe6nope, that did not help. this is the source file:  http://sprunge.us/PGKC and I am talking about the lines 58, 60 and 7225/03 23:25
joe6s/72/6225/03 23:26
xplatcopumpkin: it seems like identity^l and identity^r shouldn't be irrelevant ...25/03 23:58
xplatyou tend to need the witnesses in constructions25/03 23:58
dolioDon't you usually need them for proofs bundled in constructions?25/03 23:59
dolioNot the arrows?25/03 23:59
--- Day changed Sat Mar 26 2011
xplatdolio: these are the natural isomorphisms between I (×) A, A, and A (×) I26/03 00:00
dolioOh.26/03 00:01
dolioThen I probably agree.26/03 00:01
xplataka ‘unitors’26/03 00:02
copumpkinhmm?26/03 00:03
copumpkinwhy do you need the witnesses?26/03 00:03
copumpkinI typically just make the proofs in constructions irrelevant too26/03 00:05
copumpkinlike if you look at my slice category or something26/03 00:05
copumpkinan arrow in it is an arrow along with a proof that the triangle commutes26/03 00:06
copumpkinno point in keeping the proof around though?26/03 00:06
xplatsure, but think of a monad26/03 00:06
copumpkinwhat about it?26/03 00:06
xplatyou don't just record that the unit exists, you want to use it26/03 00:06
copumpkinhmm?26/03 00:07
copumpkinhttps://github.com/pumpkin/categories/blob/master/Category/Monad.agda ?26/03 00:07
dolioeta and mu aren't irrelevant.26/03 00:07
copumpkinI don't want them to be?26/03 00:08
copumpkinI don't really see the issue26/03 00:08
dolioIn Category.Monoidal, the natural isomorphisms for tensor with the identity are irrelevant.26/03 00:09
copumpkinoh, maybe they shouldn't be? I was just fooling around with that26/03 00:09
copumpkinoh!26/03 00:10
copumpkinI see26/03 00:10
copumpkinyes, I agree26/03 00:10
copumpkinI thought you were saying my Categry.identity^l and ^r shouldn't be irrelevant26/03 00:10
xplatok, we're on the same page26/03 00:10
copumpkinyeah, sorry26/03 00:10
copumpkindo you have your development public anywhere?26/03 00:10
xplatnot yet.  i figure that can wait until i touch more than one file26/03 00:11
copumpkinah okay :)26/03 00:11
copumpkinI'm excited26/03 00:11
copumpkinxplat: have anything in particular you want to explore once you're done with monoidal? trying to build up to CCCs?26/03 00:14
xplatcopumpkin: actually, to internal category in a monoidal category, and if possible, ‘monadoids’26/03 00:14
xplatif not, i'd like to see why it's not possible26/03 00:15
copumpkincool26/03 00:15
copumpkinjust think, we might soon be able to write "a monad is just a monoid object in the category of endofunctors, what's the problem?"26/03 00:16
copumpkinas a comment26/03 00:16
xplati'd be even more excited by 'a monadoid is just an internal category in the category of endofunctors, what's the problem?'26/03 00:17
copumpkinlol26/03 00:18
copumpkingotta go home, bbiab26/03 00:18
xplatbut first i need 'category with all equalizers', 'category with all coproducts', 'regular category', comonad, bicomodule, tensor coproduct on bicomodules26/03 00:18
xplatand conditional proofs that can (hopefully) make some endofunctor categories regular26/03 00:20
xplat(Agda's Set would be ideal.  Hask would be even idealler but very unlikely)26/03 00:25
copumpkinxplat: dammit, now you've put me in the mood for more category theory26/03 01:01
copumpkinmaybe I should do more fibration stuff26/03 01:01
joe6copumpkin, do you have any thoughts on this? source file:  http://sprunge.us/cGMK and the error is /home/j/dev/apps/haskell/agda/learn/power-of-pi.agda:60,1-39 Repeated variables in left hand side: ys y when scope checking the left-hand side view (Cons x ʟappend ys (Cons y Nil) ⅃) in the definition of view26/03 01:36
joe6i a not sure if it is due to my usage of incorrect unicode characters.26/03 01:36
joe6ʟappend ys (Cons y Nil) ⅃ : are these unicode symbols correct? ʟ ⅃26/03 01:37
joe6xplat, any thoughts, please?26/03 01:37
copumpkinwhoa26/03 01:37
copumpkinwhat are those symbols26/03 01:37
djahandarieThese are the japanese quotes 「」26/03 01:37
djahandarieNot sure what those are though26/03 01:37
joe6i do not know, in the power of pi paper, section 2.4, they are used to pattern match in a case statement.26/03 01:38
copumpkinview (Cons x ʟappend ys (Cons y Nil)⅃) | Snoc ys y26/03 01:38
copumpkinjust get rid of those things26/03 01:38
copumpkinI don't see any definition of them26/03 01:38
djahandarieUnicode contains codepoints for these symbols at U+2308–U+230B: ⌈x⌉, ⌊x⌋.26/03 01:39
djahandarieStill not the same though...26/03 01:39
joe6copumpkin, i could not find them in the lib/src, but was not sure if they are something unique.26/03 01:39
copumpkinthey're presumably defined in the paper26/03 01:39
copumpkinagda has no standard libraries26/03 01:40
djahandarie+029f   (671): LATIN LETTER SMALL CAPITAL L [ʟ] hahaha26/03 01:40
djahandarieU+2143  (8515): REVERSED SANS-SERIF CAPITAL L [⅃]26/03 01:40
copumpkinyou start with Set, dependent functions, and the ability to define records and ADTs26/03 01:40
copumpkineverything else is you26/03 01:40
joe6copumpkin, when I do that (replace the unicode symbols with paren), agda says, Could not parse the left-hand side26/03 01:41
joe6and the paper has no definiton of those symbols.26/03 01:42
copumpkinthat's because it doesn't make sense in isolation26/03 01:42
copumpkinlink to paper?26/03 01:42
copumpkinit may make sense as a dotted pattern26/03 01:42
copumpkinin fact, I think it does26/03 01:42
copumpkintry putting a dot in front of the opening paren26/03 01:42
joe6copumpkin, http://www.cs.nott.ac.uk/~wss/Publications/ThePowerOfPi.pdf26/03 01:43
joe6copumpkin, page 3, section 2.4 on views.26/03 01:43
copumpkinthen yeah26/03 01:43
copumpkinit looks like it's weird notation for a dotted pattern26/03 01:44
copumpkinview (Cons x .Nil)                    | Nil26/03 01:44
joe6oh, ok.26/03 01:44
joe6that makes sense.26/03 01:44
copumpkinview (Cons x .(append ys (Cons y Nil))) | Snoc ys y26/03 01:44
joe6copumpkin,  that worked. Thanks a lot.26/03 01:45
copumpkinnp :)(26/03 01:45
joe6djhandarie, where did you get those unicode numbers? I cannot seem to get a good unicode list..26/03 01:54
copumpkinI just use the character map on my mac26/03 01:54
copumpkinnot sure how painful it is on other platforms26/03 01:54
joe6copumpkin, ok, thanks.26/03 01:56
djahandariejoe6, http://mauke.dyndns.org/stuff/javascript/unicode.html26/03 01:57
joe6djhandarie, thanks26/03 01:59
* copumpkin jugs john major equality26/03 02:04
joe6copumpkin, stupid question, how are the dependent types dependent from overloaded objects of OO?26/03 02:58
copumpkindifferent?26/03 02:58
joe6copumpkin, stupid question, how are the dependent types different from overloaded objects of OO?26/03 02:58
joe6copumpkin, yes, sorry.26/03 02:58
copumpkinoverloaded objects?26/03 02:58
copumpkinnot fully knowing what you mean by that, I'd say that they give you static guarantees26/03 02:58
joe6with haskell typeclasses, I could understand the class and instance..26/03 02:58
copumpkineven those are mostly unrelated to OO26/03 02:59
joe6but, with agda, the show is defined at one spot for all the different related types, then are we not losing the flexibility of haskell typeclasses?26/03 03:00
copumpkinI wouldn't think of it as show26/03 03:00
copumpkinit's not a runtime thing26/03 03:02
copumpkinit just lets you introspect the structure of your terms at typechecking time26/03 03:02
copumpkinso the main point of all this is that it's a very powerful static reasoning system26/03 03:04
joe6oh, ok. other than the type-checking time and runtime operation, the functions defined here seem very similar to overloaded functions of C++/java?26/03 03:04
copumpkinhmm, I wouldn't say that26/03 03:04
joe6at least in the paper, they have one show for all the different datatypes and one read..26/03 03:05
joe6and the show, according to the paper, operates on a closed datatype26/03 03:05
copumpkinagda doesn't have typeclasses26/03 03:06
joe6in Page 6 of the paper, it says "Note that, in contrast to Haskell's type classes, the data type U is closed."26/03 03:06
copumpkinI think the point isn't so much show and read, as much as being able to statically guarantee that bad things can never happen26/03 03:06
copumpkinin haskell, I can still write printf "%s ohai" 526/03 03:06
copumpkinand that will fail at runtime26/03 03:06
joe6copumpkin, oh, ok. so, is there an equivalent in agda for haskell's deriving?26/03 03:07
copumpkinno, not at all26/03 03:08
copumpkinagda has no typeclasses and no shortcuts for saving the user work like that26/03 03:08
joe6would that not be a problem to define all the required functions when building a type? too much boilerplate?26/03 03:08
copumpkinit could be, yes26/03 03:09
copumpkinit technically allows you to build your own automatic builders though26/03 03:09
copumpkinwith universes26/03 03:09
joe6then, it is possible to implement your own deriving?26/03 03:10
copumpkinsort of, but it isn't necessarily easy26/03 03:10
joe6why do you say that? Can you not have a type such as Set, but ProjectSet or something26/03 03:11
copumpkinsure, but it'll be closed26/03 03:11
joe6yes..26/03 03:12
jmcarthurjoe6: i disagree with that paper on what they showed being a replacement for type classes26/03 03:12
joe6need something like TemplateHaskell to generate the boilerplate code, then..26/03 03:12
jmcarthurjoe6: it's common to use dictionaries in place of type classes26/03 03:12
joe6jmcarthur, oh, ok.26/03 03:12
jmcarthurjoe6: and dictionaries are at least open :)26/03 03:12
joe6jmcarthur, let me search for dictionaries, then.26/03 03:12
jmcarthurjoe6: basically just a thing you can pass around that has the implementation you would otherwise have put in a type class26/03 03:13
joe6jmcarthur, any suggestions on where I can find more details on dictionaries. do not recall seeing anything in the mailing list archives.26/03 03:13
jmcarthurit's not an agda-specific sort of thing26/03 03:13
jmcarthurit's just a record, basically26/03 03:13
jmcarthurjoe6: for example: http://www.cse.chalmers.se/~nad/listings/lib-0.5/Category.Monad.Indexed.html#39426/03 03:14
joe6jmcarthur, ok, thanks. let me digest it.26/03 03:14
jmcarthurjoe6: an example of an "instance" http://www.cse.chalmers.se/~nad/listings/lib-0.5/Data.List.html#741126/03 03:16
joe6agda keeps complaining about the _++_ operator. The operator worked fine until I imported the string ++, I tried to do this: open import Data.String as S using (_++_)26/03 03:36
joe6and using any string related ++ as S.++26/03 03:36
joe6just curious if it is possible to import similar function names?26/03 03:37
joe6source file:  http://sprunge.us/eVAe26/03 03:37
joe6looks like the link: http://www.cs.chalmers.se/~ulfn/darcs/Agda2/examples/lattice of the page http://wiki.portal.chalmers.se/agda/pmwiki.php?n=ReferenceManual.Records is not working.26/03 03:49
joe6any chalmers folks around?26/03 03:49
copumpkinI'd like a feature in agda where I can put my cursor on an implicit application and ask it if removing it would be yellow26/03 03:51
xplatthat would be nice26/03 03:54
copumpkinxplat: I've made some changes to how the Morphism module works. I don't think it'll affect your code much though26/03 03:55
copumpkinI'll push in a bit26/03 03:55
xplatthanks for the heads up26/03 03:56
joe6copumpkin, how do I import a definition when another similar named function exists in the current module?26/03 03:57
copumpkinjoe6: use renaming, or don't open the import26/03 03:58
joe6I did this, open import Data.String as S using (_++_)26/03 03:58
copumpkindon't open it26/03 03:58
copumpkinor rename it26/03 03:58
joe6let me try.26/03 03:58
joe6sorry, ok, will try.26/03 03:59
joe6command line agda seems to be faster than the emacs interface...26/03 04:12
copumpkinxplat: okay, nevermind26/03 04:15
copumpkinthat seemingly harmless change made a lot of stuff more painful, so I reverted it26/03 04:15
joe6copumpkin, that worked. Thanks a lot.26/03 04:19
joe6copumpkin, btw, in haskell, i used to use import as X and put a prefix for the common functions. Isn't there such a prefix available in agda?26/03 04:20
joe6i put the prefix X for the common functions.26/03 04:20
copumpkinyou just import a module without opening it26/03 04:21
copumpkinyou can name it26/03 04:21
copumpkinand then access things as M.x26/03 04:21
joe6copumpkin, ok, thanks.26/03 04:22
Saizanto name it you've to say e.g. "module L = Data.List"26/03 06:22
joe6saizan, unicode is pretty. worth the trouble..26/03 13:43
joe6i want to import the >>= operator for Data.Maybe . I can see the definition of >>= in the IO.agda file but not in the Data.Maybe.agda file. though, I do see a function called monad in the Data.Maybe26/03 14:50
joe6any thoughts, please?26/03 14:53
Saizanyou can "open RawMonad monad"26/03 14:55
joe6Saizan, ok, thanks.26/03 15:01
jmcarthuri find that the boilerplate of managing imports and scoping and junk discourages me from doing a lot of things i would normally do in haskell. for example, i don't really touch function composition at all in agda and tend to write everything pointfully26/03 19:18
SaizanFunction doesn't seem to export anything that clashes with what i define26/03 19:34
jmcarthurmaybe function composition was a poor example26/03 19:40
jmcarthuri rarely use Monad in agda26/03 19:41
jmcarthur(so far)26/03 19:41
jmcarthuri guess it isn't going to *clash* either, but it's still boilerplatey to use26/03 19:41
Saizanopening modules is not that bad, the painful part is when you want to use two monads at once26/03 19:44
joe6which is better to use? Lib.Maybe or Data.Maybe of standard lib?26/03 22:16
joe6i can see the Lib.Maybe seems to export >>=, but I am struggling to find that exported in the standard lib.26/03 22:17
joe6i can see the Data/IO.agda exports the >>=, but it seems to be a field of the monad record in Data/Maybe.agda.26/03 22:18
joe6any thoughts, please?26/03 22:18
joe6jmcarthur, do you use Lib.Maybe or the Data.Maybe of the standard library?26/03 22:19
Saizanopen import Data.Maybe; open import Category.Monad; open RawFunctor Data.Maybe.monad26/03 22:19
joe6jmcarthur, when you do use them, I mean..26/03 22:19
copumpkinLib.Maybe?26/03 22:20
copumpkinwhat's Lib?26/03 22:20
joe6Saizan, No such module RawFunctor when scope checking the declaration  open RawFunctor Data.Maybe.monad ; my source is:  http://sprunge.us/IfiR26/03 22:24
Saizani should have said RawMonad, sorry26/03 22:24
joe6copumpkin, in the agda darcs repo, there is a directory called Lib, which has a bunch of such agda files.26/03 22:25
copumpkinoh26/03 22:25
copumpkinI'd imagine that's out of date26/03 22:25
joe6Saizan, that worked. Thanks.26/03 22:25
joe6Saizan, doing this, i think, imports the open import Category.Monad using (RawMonad)26/03 22:40
joe6Saizan, imports the RawMonad function and not the module26/03 22:41
joe6is there a using clause to import the module RawMonad and not the function RawMonad.26/03 22:41
joe6Saizan, by doing "open RawMonad monad26/03 22:42
joe6", we are opening the module RawMonad with a parameter of monad?26/03 22:42
joe6Saizan, just wanted to check if my understanding is correct?26/03 22:42
joe6Saizan, i tried import Category.Monad.RawMonad, but it does not seem to import the module RawMonad of Category.Monad.26/03 22:45
joe6Saizan, trying something like this,  http://sprunge.us/OgNE26/03 22:46
joe6Saizan, what you said works. I am just trying to figure out how to bring a sub-module into scope without importing the full top module.26/03 22:47
joe6Saizan, don't bother. This works,  http://sprunge.us/LBhi26/03 22:53
joe6to confirm my understanding an " open import <module> using ()" gets all the submodules of <module> into the current namespace.26/03 22:54
danrjoe6: just a little hint, if you have several constructors with the same type, you can list them "under the same :", as in26/03 23:19
danrdata Sheep : Set where26/03 23:19
danr  Joe Jack Samatha ... Sam : Sheep26/03 23:19
danror26/03 23:19
danrdata Bool : Set where26/03 23:19
danr  true false : Bool26/03 23:19
copumpkinsame with multiple arguments of the same type26/03 23:19
joe6danr, that is cool. Thanks.26/03 23:21
joe6danr, i am having trouble understanding how the bind operator is bound to the monad. In haskell, there is a monad class exporting 2 functions, return and bind. and, every datatype that is instance'd to that monad class needs to define the return and bind, and they get to be part of the monad class.26/03 23:30
joe6How does that transfer to agda?26/03 23:30
copumpkinyou'd typically have a record definition for the class definition26/03 23:31
joe6I see the record and fields (return and bind). but, I am not able to identify the relationship of the monad record to the Maybe monad, for instance.26/03 23:31
copumpkinand values of that record correspond to instances26/03 23:31
copumpkinyou mean monad in CT?26/03 23:31
joe6copumpkin, no, just the haskell monad.26/03 23:32
copumpkinlink to the code you're talking about?26/03 23:32
joe6i can see the Category.Monad has RawMonad, RawMonadZero and RawMonadPlus. I assume that they correspond to the haskell monad, monadzero and monadplus.26/03 23:33
copumpkinmore or less, yeah26/03 23:33
copumpkinoh, they're defined in terms of indexed monads26/03 23:34
copumpkinis that what confuses you?26/03 23:34
joe6copumpkin, yes.26/03 23:34
copumpkinan indexed monad is neat26/03 23:34
copumpkinI still haven't worked through what it means in category theory, really26/03 23:34
joe6copumpkin, give me one second, I will type up what I am talking about.26/03 23:35
copumpkinbut it lets you write things like state where the type of the state variable changes throughout the computation26/03 23:35
joe6copumpkin, in Data/Maybe.agda, I can see a monad function defined. It seems to be referring to the monadT, which is defined as a record of fields: return and bind. the monadT types are the RawMonad, defined in Category/Monad.agda26/03 23:37
copumpkinyeah26/03 23:37
copumpkinthat's effectively an instance declaration26/03 23:37
joe6I see the relation between RawMonad => monadT => monad, but I do not understand what is going on in that code.26/03 23:37
copumpkinit should look very much like MaybeT26/03 23:38
joe6something in english explaining that might help a lot of beginners too..26/03 23:38
copumpkinhttp://hackage.haskell.org/packages/archive/MaybeT/0.1.2/doc/html/src/Control-Monad-Maybe.html#MaybeT26/03 23:39
joe6and how is all this linked by, open Category.Monad.RawMonad Data.Maybe.monad26/03 23:39
copumpkinI'm not quite sure what part of it you don't understand26/03 23:41
joe6copumpkin, i probably need more experience with agda code. I will bother you about this in a few more days. Hopefully, I will get the hang of the basics, by then.26/03 23:43
copumpkinbut basically, in this case, record declarations correspond to a class declaration in haskell, and if you build a value of that record, that's an instance declaration in haskell26/03 23:43
copumpkinyou pass records explicitly, unlike haskell26/03 23:43
copumpkinif you don't understand the bind and join themselves, you should try to figure out the haskell MaybeT monad transformer26/03 23:44
joe6copumpkin, ok, thanks.26/03 23:49
joe6this is my source,  http://sprunge.us/BGUG . I am trying to import mplus. I think it is monadPlus in agda. If I write "open Category.Monad.RawMonadPlus Data.Maybe.monadPlus26/03 23:52
joe6", it is breaking the (just x).26/03 23:52
joe6so, I think the line 'open  Category.Monad.RawMonadPlus Data.Maybe.monadPlus" is wrong.26/03 23:52
copumpkinwhy?26/03 23:53
copumpkingotta go26/03 23:54
copumpkinwill bbl26/03 23:54
joe6copumpkin,  http://sprunge.us/JSNg26/03 23:54
joe6copumpkin, this is the erro message.26/03 23:54
nappingthat's certainly breaking the >>= rather than the just26/03 23:55
nappingYou should figure out how Category.Monads.Indexed is getting into scope26/03 23:56
joe6napping, i think I should be using _|_ instead of monadPlus26/03 23:58
joe6napping, I think this line 'open  Category.Monad.RawMonadPlus Data.Maybe.monadPlus" is wrong.  http://sprunge.us/CPbO26/03 23:58
joe6i want to use mplus26/03 23:59
joe6of haskell.26/03 23:59
--- Day changed Sun Mar 27 2011
nappingthat's a class method, I'm not sure how you can use classes27/03 00:02
joe6napping, this is what I have: parent : Sheep -> [ Sheep ] -- get all or any parents of the sheep27/03 00:03
joe6parent x : (mother x) `mplus` (father x) -- my objective.27/03 00:03
dolionapping: To answer your question, I know a thing or two about induction.27/03 00:04
joe6i see an operator _|_ in Data/Maybe.agda and I am assuming that it is the haskell's mplus equivalent.27/03 00:04
nappingah, just the one for Maybe is probably available27/03 00:05
nappingseems like that code should work27/03 00:07
nappingdolio: in particular, do you know what the notion of induction is for Haskell types (or CPOs in general)?27/03 00:08
dolioI've been thinking about that a little. I'm not entirely sure.27/03 00:08
dolioAt a guess, I'd say that you need to prove that P is preserved by every constructor, bottom, and lubs of monotone sequences.27/03 00:09
dolioBut I'm not certain.27/03 00:10
dolioP being the predicate you want to prove by induction.27/03 00:10
nappingYou don't have (strong) products or coproducts27/03 00:10
nappingconsider double Z = Z; double (S n) = S (S (double n))27/03 00:11
nappingI'm not sure if you can pick a subobject classifier that can handle it27/03 00:11
dolioYou wouldn't be proving things about Haskell programs within Haskell. It isn't a very good language for that.27/03 00:15
dolioThe property that Harper likes about ML is that programs in the language (by structural recursion) and proofs about the language (by induction) look very similar.27/03 00:16
dolioBecause you can get away with imagining everything is very set-like.27/03 00:17
dolioBut you can't do that in Haskell.27/03 00:17
dolioDefining a function in Haskell looks set-like, but proving things by induction externally will look domain-like.27/03 00:18
dolioUnless you come up with a set-like way to prove things about the latter. But I don't know how to do that.27/03 00:19
dolioSo Haskell breaks the symmetry.27/03 00:19
dolioAgda by contrast is actually equipped to be a 'logic' for its own programs.27/03 00:20
* jmcarthur wonders what agda for first-year CS students would be like ;)27/03 00:21
byorgeyjmcarthur: sounds fun =)27/03 00:49
nappingI've read some of a paper by Jacobs about induction, which relied on your universe of propositions being a fibration over the space where your initial algebra lives27/03 02:06
dolioFibrational Induction Rules... or whatever?27/03 02:07
napping"An algebraic view of structural induction"27/03 02:13
dolioOh.27/03 02:13
dolioThe one I'm thinking of may be an extension of that work. They mention it.27/03 02:18
dolioFibrational Induction Rules for Initial Algebras.27/03 02:19
dolioBy Ghani, Johann and Fumex.27/03 02:19
dolioIt even has an example of induction for wcpo.27/03 02:22
dolioI can't actually remember if I read this paper or not. I thought I did, but I don't remember anything from it.27/03 02:22
dolioThe wcpo example they use is for a type that can't be interpreted as a set, but I guess their approach would also work for Haskell, where types are obviously not interpreted as sets even if the functor defining them would have a counterpart for sets.27/03 02:24
xplatgood old 'generally recursive, referentially transparent, having proper sums and products: pick any two'27/03 02:31
nappingwhy does that fail?27/03 02:36
joe6solistic, are you still around?27/03 03:09
joe6solistic, just wanted to see how your journey is coming along..27/03 03:09
dolioOh, maybe I stopped reading this paper to go learn about fibrations.27/03 03:45
joe6in agda, a function has to be defined before it is used. I notice that behaviour, just wanted to check if it is expected behaviour..27/03 14:54
Saizanyep27/03 14:55
Saizanyou can use mutual to introduce a block where definitions can be mutually recursive27/03 14:56
joe6any suggestions on whether this source can be written better:  http://sprunge.us/DXWF27/03 14:57
joe6Saizan, ok, thanks.27/03 14:57
joe6any suggestions on how I can write something like this in agda: http://sprunge.us/fbcC27/03 14:59
joe6or, atleast the instance piece (reusing the agda's monadPlus implementation)27/03 15:00
benmachinethat's not the usual definition for MonadPlus :o27/03 15:00
Saizanyeah, why those types?27/03 15:02
joe6i am trying to solve the "all about monads" paper in agda27/03 15:03
joe6yes, that is not the definition of monadPlus in haskell, but I am trying to learn how the class and instance translates to agda. I think it has something to do with record and fields, but could not understand it fully.27/03 15:04
joe6s/solve/follow/27/03 15:05
Saizanyou make a record type with the same arguments of the class, and with the methods of the typeclass as fields27/03 15:06
joe6Saizan, ok, thanks. let me try.27/03 15:06
Saizansee e.g. IsMonoid in the standard lib27/03 15:07
Saizanthough that's probably parametrized on the equality, so more complex than the standard Monoid class27/03 15:08
joe6Saizan, will do, thanks. but, my problem is that I am getting lost in the code whenever I look at the standard lib code. maybe, isMonoid is simpler.27/03 15:08
Saizan"record Monoid (m : Set) : Set where field { mempty : m; mappend : m -> m -> m }" would be a direct translation from haskell's Monoid27/03 15:10
Saizanthough in Agda you'd also add the monoid laws27/03 15:10
joe6Saizan, thanks, that was easy.27/03 15:35
joe6Saizan, if you have any comments:  http://sprunge.us/ZWVT27/03 15:35
Saizanwell, you just delcared the record, you didn't build an "instance"27/03 15:48
copumpkinhttp://homotopytypetheory.org/2011/03/26/higher-fundamental-groups-are-abelian/27/03 16:36
joe6Saizan, any thoughts on this, please?  http://sprunge.us/NcWM27/03 17:53
joe6Saizan, i can get the testmappend to work, but not the parent function.27/03 17:53
joe6Saizan, this is what the compiler says, /home/j/dev/apps/haskell/agda/learn/all-about-monads.agda:91,19-2727/03 17:55
joe6Sheep != ℕ of type Set27/03 17:55
joe6when checking that the expression mother x has type Maybe27/03 17:55
joe6Saizan, i am still trying to figure out how to fix this, but anyway, just wanted to check if that is the way to do it.27/03 17:56
Saizanjoe6: you got the definition of MyMonadPlus wrong27/03 17:56
Saizan'a' should be quantified in the type of each method, not be a parameter27/03 17:57
Saizanrecord MyMonadPlus m : Set where field mzero : {a : Set} -> m a -> List a; mplus : {a : Set} -> m a -> m a -> List a27/03 17:58
joe6Saizan,  http://sprunge.us/OaHL , modified source. this is what the compiler says when I do that : /home/j/dev/apps/haskell/agda/learn/all-about-monads.agda:70,24-2727/03 18:02
joe6The type of the constructor does not fit in the sort of the27/03 18:02
joe6datatype, since Set₁ is not less or equal than Set27/03 18:02
joe6when checking the definition of MyMonadPlus27/03 18:02
Saizanah, right, you've to make it Set127/03 18:03
Saizanrecord MyMonadPlus m : Set1 where field mzero : {a : Set} -> m a -> List a; mplus : {a : Set} -> m a -> m a -> List a -- like this27/03 18:03
joe6oh, ok, thanks.27/03 18:04
Saizana type that quantifies over a "Set n" ends up being in "Set (n+1)" at least, and Set = Set 027/03 18:05
joe6Saizan,   http://sprunge.us/ATUS , modified source. this is what the compiler is saying now: /home/j/dev/apps/haskell/agda/learn/all-about-monads.agda:72,36-3927/03 18:07
joe6Set != Set₁27/03 18:07
joe6when checking that the expression m a has type Set₁27/03 18:07
joe6Saizan, it makes sense to have Set127/03 18:07
joe6it is complaining about the second "m a" of mplus27/03 18:08
Saizantry giving a type signature to m27/03 18:08
copumpkinif you use a real paste site, we can see line numbers too :)27/03 18:08
Saizane.g. record MyMonadPlus (m : Set -> Set) : Set1 where ..27/03 18:08
copumpkinI guess that is a real paste site, but it's not very friendly27/03 18:08
joe6ok, I use sprunge as it is easy to paste from the command line... will find another one.27/03 18:10
copumpkinthat's fine27/03 18:10
joe6Saizan, that worked. Thanks.27/03 18:11
Saizansounds like a bug, if it reported a type error where a type signature could make it work27/03 18:14
joe6Saizon, ok, will send it to the mailing list.27/03 18:19
copumpkinor just put it on the bug tracker27/03 18:21
joe6copumpkin, ok, will do.27/03 18:28
joe6Saizan,  http://sprunge.us/fLSc, at the bottom, is something like "record MyMasterMonadPlus" possible?27/03 18:45
joe6Saizan, i would assume that it is. but, i get the below error: /home/j/dev/apps/haskell/agda/learn/all-about-monads.agda:114,14-2127/03 18:45
joe6Type mismatch27/03 18:45
joe6when checking that the pattern nothing has type Maybe a27/03 18:45
joe6or, maybe it just needs parens..27/03 18:46
joe6let me try.27/03 18:46
joe6nope, that did not work with parenthesis either --  http://sprunge.us/jOOM27/03 18:47
joe6Saizan, i am probably missing something...27/03 18:47
Saizanyou can't pattern match on types like that27/03 18:48
joe6Saizan, makes sense.. in lines 105, I am using the prefix of M. to use the mplus instantiated with the List monad.27/03 18:51
joe6In haskell, we just use >>= and it just figures out the context. Doesn't it? Is that possible here?27/03 18:51
joe6that is, use >>= between List's or Maybe's without the need for prefixes27/03 18:52
joe6copumpkin, http://pastebin.com/mpe98X3R27/03 19:01
joe6copumpkin, i have the command line to pastebin working, so there it is..27/03 19:02
Saizanno, you can only have one >>= in scope, you can open modules inside a where clause though, so the bindings will scope only locally27/03 19:04
joe6Saizan, oh, ok. In haskell, once we say that the type belongs to the Eq class, everywhere we use the type in an Eq context, the corresponding instance method is automatically used. In agda, we would have to explicitly get the corresponding instance method into scope when we need it?27/03 19:07
joe6Saizan, sorry if it is a repitition of what you said. It seems to be a regression, in this case. Do you agree?27/03 19:08
joe6or, maybe, it could be looked at as the "code being more modular"..27/03 19:08
joe6so, there is no concept of typeclasses? similar functionality could have similar named functions, but no "typeclass" mechanism instead. Am I correct?27/03 19:09
joe6http://pastebin.com/FiT5C21Z , something like this is also not possible, then..27/03 19:37
Saizanyou could use universes, like in "the power of pi" iirc27/03 20:19
Saizananyhow, no, there's nothing like typeclasses in agda currently27/03 20:20
joe6Saizan, ok, thanks. I am still learning, hence the questions.27/03 20:36
joe6i am looking at the type signature of the compose function: _∘_ : ∀ {a b c}27/03 22:40
joe6        {A : Set a} {B : A → Set b} {C : {x : A} → B x → Set c} →27/03 22:40
joe6      (∀ {x} (y : B x) → C y) → (g : (x : A) → B x) →27/03 22:40
joe6      ((x : A) → C (g x))27/03 22:40
danrquite daunting :)27/03 22:41
joe6in haskell, it is: (.) :: (b -> c) -> (a -> b) -> a -> c27/03 22:41
joe6danr, yes, I am trying to understand it and I do not understand why the last line has: ((x : A) → C (g x))27/03 22:41
danrwell, it captues that c can depend on the value returned by a and b27/03 22:41
joe6doesn't C == g x ?27/03 22:42
copumpkinno27/03 22:42
copumpkinC is a function {x : A] -> B x -> Set c27/03 22:42
danrg "is" the (a -> b) in the haskell version.27/03 22:42
danr(g : (x : A) → B x)27/03 22:43
danrso the last (a -> c), there C depends on the value of A, via g27/03 22:43
danrso there's also _$_ and flip in the standard library, defined with dependent types, then. They are a bit easier to grasp than _∘_27/03 22:47
jmcarthurjoe6: basically it's just a more general version of haskell's so that later arguments' types can depend on earlier ones27/03 22:47
jmcarthur*on earlier arguments' values27/03 22:48
joe6copumpkin, danr, jmcarthur, I am still digesting what you said. writing them down piece-by-piece using the good old pen-and-paper method.27/03 22:51
joe6isn't this: {A : Set a} {B : A → Set b} {C : {x : A} → B x → Set c} →  , a duplicate of (∀ {x} (y : B x) → C y) → (g : (x : A) → B x) → ((x : A) → C (g x)) ?27/03 22:54
joe6the first portion of the type signature, implicit arguments, seem to be a duplicate of the function signature?27/03 22:55
danrnot really, remember in haskell you dont need to type out which type variables you use, but you can27/03 22:55
danr (.) :: forall a b c . (b -> c) -> (a -> b) -> a -> c27/03 22:55
joe6danr, makes sense, thanks.27/03 22:55
danrnp :)27/03 22:57
joe6i understand that all types belong to a base type called Set. is this line " {A : Set a} {B : A → Set b} {C : {x : A} → B x → Set c}" just saying that A, B, C are base types and that B belongs to a set which is dependent on A..27/03 23:01
joe6and so on and so forth..27/03 23:02
joe6is it not enough to have {A : Set} instead of {A : Set a}? Is it used to convey that the Sets that A belongs to is different from the Set that the base type B belongs to..27/03 23:04
joe6something similar to Set1, Set0, Set2, etc..27/03 23:04
Saizan"Set a" is part of universe polymorphism, the 'a' is supposed to be the universe level, i.e. one of 0,1,2,3,..27/03 23:05
Saizanthat way _∘_ can work at any level27/03 23:06
joe6Saizan, oh, ok. So, could it have been {A : Set1} too?27/03 23:06
Saizanyes, if you wanted a more specific version27/03 23:07
joe6Saizan, thanks27/03 23:07
--- Day changed Mon Mar 28 2011
joe6why is the type signature of map "map : {A B : Set} -> (A -> B) -> List A -> List B' and "not map : {A B : Set} -> ((x : A) -> B x) -> List A -> List B"28/03 02:58
joe6or is "(A -> B)" == "((x : A) -> B x)"??28/03 02:58
jmcarthurjoe6: it would have to be  map : {A : Set}{B : A → Set} → ((x : A) → B x) → List A → List (B x)28/03 03:51
jmcarthurjoe6: and that won't work28/03 03:51
jmcarthurjoe6: because x is out of scope in the result type28/03 03:51
jmcarthuralthough i suppose you could make a variant that might work28/03 03:51
jmcarthursomething like  map : {A : Set}{B : A → Set} → ((x : A) → B x) → List A → List (Σ[ x ∶ A ] B x)28/03 03:52
jmcarthurbut then it's not quite the same thing28/03 03:53
copumpkinLists have homogeneous types28/03 04:05
copumpkinyou could map the types and values separately if you had a heterogeneous list28/03 04:05
xplatheterogenous lists seem to make a lot more sense in DTT than in the typical settings28/03 13:46
copumpkinyeah28/03 13:48
sullyDTT?28/03 13:48
copumpkinit's always bothered me that I can't seem to find a good way to define them elegantly in a single type though28/03 13:48
copumpkinsully: dependent type theory, maybe?28/03 14:03
xplatyes28/03 14:18
* Saizan wonders how much work it'd be to create the stub of a lemma out of the type of a hole 28/03 14:34
danrI don't know but it would be sweet to have28/03 14:41
danranyone know any references to define structures using the W-type?28/03 14:42
danrIt's a bit akward to seach for wtype28/03 14:42
Saizan"observational equality, now!" has at least the naturals as an example28/03 14:45
danraha, thanks!28/03 14:46
danrso I guess the ground is 0, 1, 2 i.e. ⊥, ⊤ and Bool?28/03 14:51
danr(sorry thinking loud, the answer was in the next paragraph)28/03 14:52
danr(thinking with my keyboard - or something)28/03 14:52
* copumpkin missed the beginning of that, but you mean for a dependently typed system with pi and sigma?28/03 14:55
danrI'm reading about W-types in "Observational Equality, now!"28/03 14:56
danrThere the notation 0,1,2 is used28/03 14:56
copumpkinah, probably then28/03 14:56
danrThis is quite reasonable:28/03 14:57
danrTr : Bool → Set; Tr true  = ⊤; Tr false = ⊥28/03 14:57
danrNat : Set; Nat = W Bool Tr28/03 14:57
danrI was looking for some way to do ⊥,⊤ and Bool using W, but I guess that's not possible (?)28/03 14:58
Saizanyou can, but by using them :)28/03 14:59
copumpkinyou need some notion of an index for W28/03 14:59
danrIn what sense do you mean index?28/03 15:00
danrSaizan: :)28/03 15:00
djahandarieHow would you write a heterogeneous list in Agda?28/03 15:03
Saizanindexing it by a list of types28/03 15:03
Saizancopumpkin: http://code.google.com/p/agda/issues/detail?id=393 <- seen NAD's comment?28/03 15:06
copumpkinSaizan: oh, I thought I tried that. I'll take a look after work28/03 15:06
Saizanhttps://lists.chalmers.se/pipermail/agda/2011/002873.html <- that's a pretty extreme form of type inference :)28/03 15:20
Saizanvery cool28/03 15:20
djahandarieThat's pretty hardcore28/03 15:22
danrsweet ^^28/03 15:24
xplatwhoa28/03 15:33
copumpkinhah yeah28/03 15:34
xplatwait, what is __?28/03 15:36
djahandarieWhere is __?28/03 15:37
copumpkinit's a single underscore, isn't it?28/03 15:37
xplatp ^ suc n = __ <$> p (*) p ^ n28/03 15:37
copumpkinoh28/03 15:37
djahandariexplat, there is a :: in the middle28/03 15:37
copumpkinyou're missing the double colon28/03 15:37
djahandarie28/03 15:37
copumpkinhttp://snapplr.com/k63228/03 15:37
copumpkinxplat: you may be the master of the IRC unicode, but clearly your browser can't keep up with you! muahaha28/03 15:38
djahandarieYou should write an Agda highlighter in Javascript28/03 15:38
djahandarieObviously not as powerful as the one in emacs28/03 15:38
xplatthe only way i would ever produce an agda highlighter in javascript is by taking advantage of the js backend for llvm28/03 15:39
djahandarieHaha28/03 15:39
copumpkinsince the one in emacs is actually in haskell28/03 15:39
copumpkinand using the official parser28/03 15:39
djahandarieYeah lol28/03 15:39
xplatand when i did it would crash browsers :I28/03 15:39
copumpkinand since highlighting agda like the emacs one does actually requires full typechecking28/03 15:39
djahandarie:(28/03 15:39
copumpkinbut if you're willing to give up a separate color for constructors, you can get away with just a regular parse28/03 15:40
copumpkinseems like a fair trade-off28/03 15:40
djahandariecopumpkin, so, you'll have this complete highlighter in Javascript done by, let's say, Wednesday?28/03 15:40
djahandarieI definitely need the seperate color for constructors28/03 15:40
djahandarieMake sure to highlight any code that doesn't type check too28/03 15:40
copumpkinsounds good28/03 15:41
xplati guess you could just use one of the well-known mixfix parsers for js :P28/03 15:41
copumpkinwith universe-polymorphic, irrelevant, dependent type checking, yep28/03 15:41
xplati'm actually a bit scared to find out how mixfix works ...28/03 15:42
copumpkinabandon all hope, ye who enter here28/03 15:43
copumpkindanr, by the way, there's a decent overview of W types and lots of other interesting stuff in http://www.cs.kent.ac.uk/people/staff/sjt/TTFP/ttfp.pdf28/03 15:49
danrcopumpkin: nice, thanks!28/03 15:55
copumpkinthe stuff on W types is around half way through28/03 15:56
copumpkinlook for well founded types28/03 15:56
danrquite a book28/03 15:56
copumpkinit's basically describing a lot of agda28/03 15:56
copumpkinwithout actually being about agda28/03 15:56
danrvery interesting!28/03 15:57
jmcarthuri haven't yet gotten used to the idea of sticking _ on the rhs28/03 16:08
jmcarthurin fact, it was only recently that i discovered that i could do that28/03 16:11
danrI don't know if I ever did it for the entire rhs28/03 16:18
danrbut I use it all the time to arguments for, say, ∧-assoc :)28/03 16:19
* xplat sighs28/03 16:30
xplathave to write some glue to put (A ⊗ B) ⊗ C and A ⊗ (B ⊗ C) on the same source category so there can be a natural isomorphism between them ...28/03 16:33
xplatCategory.Product takes surprisingly long to load for such a small module28/03 16:42
xplati don't suppose there's a library for functorial equivalence ...28/03 16:44
xplater, a module28/03 16:44
dolioYes, those proofs I wrote are quite good at eating resources.28/03 16:45
xplatthey look so simple!28/03 16:45
dolioThey took a fair amount of time to write, too.28/03 16:46
dolioAlthough a lot of that may have been reloading the module.28/03 16:46
xplatit seems like using tuples and fst and snd at type level really kills performance28/03 16:46
xplati don't know why this should be28/03 16:47
djahandarieBy the way, is there a name for the trick/feature NAD used to infer the whole RHS?28/03 16:58
xplatwell, if scala has the 'pimp my library' pattern, perhaps agda can have the 'balls of steel' pattern28/03 16:59
djahandarieHahahaha28/03 16:59
xplatboy it's a good thing i didn't go get a sandwich while this file was reloading since there was an extra paren28/03 17:01
dolioDepends what you mean.28/03 17:19
dolio'Type inference' in a dependently typed language essentially requires arbitrary code inference/unification.28/03 17:20
dolioSo that's what it's doing.28/03 17:20
dolioJHC illustrates another aspect of that.28/03 17:22
dolioInternally it's like a pure type system.28/03 17:22
dolioAnd it does type passing, and implements type classes by case analysis on types.28/03 17:23
dolioBut, a lot of times passing the types aren't necessary.28/03 17:23
djahandarieI asked if Agda was a PTS a while ago and heard that it wasn't28/03 17:24
dolioBut, instead of only handling that for types, it does arbitrary useless variable analysis, as I recall.28/03 17:24
dolioNo, it isn't.28/03 17:24
dolioPure type systems are lambda terms (and types) only.28/03 17:24
dolioSo, having inductive types built in makes you not a pure type system.28/03 17:25
djahandarieAh. But it is still 'based' on a pure type system in the sense that it doesn't bother explicitly talking about the higher levels like kinds and sorts?28/03 17:25
djahandarieOr am I wrong there too?28/03 17:26
copumpkinI thought the only sense of PTS was not having any values but lambdas28/03 17:27
dolioI guess you can technically have some other built-in stuff due to the way pure type systems are specified.28/03 17:27
dolioIt has a set of "constants".28/03 17:27
dolioWhich are normally taken to be the sorts, but you could put particular types and values in there, too.28/03 17:28
xplatglue is finished: preassoc : ∀ {o₁ ℓ₁ e₁ o₂ ℓ₂ e₂ o₃ ℓ₃ e₃} (C : Category o₁ ℓ₁ e₁) (D : Category o₂ ℓ₂ e₂) (E : Category o₃ ℓ₃ e₃) → Functor (Product (Product C D) E) (Product C (Product D E))28/03 17:29
copumpkinooh28/03 17:29
xplati hope it's got enough proofs to use it without having proved it an equivalence28/03 17:30
copumpkinI've added a few things since you last pulled, probably28/03 17:30
xplathm, guess i should pull again28/03 17:31
copumpkinincluding a basic (probably will be rewritten once you're done) definition of part of a 2-category28/03 17:31
copumpkinbut it's nothing that should affect you28/03 17:31
xplatalso i should reacquire my github account later today and do the magic incantation to redirect my git upstream28/03 17:32
copumpkinblack magic28/03 17:32
copumpkingit remote add mygithub <your url>, git push mygithub master28/03 17:32
doliodjahandarie: Anyhow, one insight from pure type systems is that implementing a typed lambda calculus can involve only implementing a Term type, more or less. It can have a 'Constant' constructor, and what constants you have, and some rules on top of them determines what sort of language you get out.28/03 17:33
dolioSo types and values and kinds need not be treated distinct from one another.28/03 17:33
dolioAnd you can do useless-type-passing analysis by just doing useless variable analysis.28/03 17:34
xplatall the members of the functor record for preassoc are either ‘λ x → fst (fst x) , snd (fst x) , snd x’ or ‘IsEquivalence.refl C.Equiv , IsEquivalence.refl D.Equiv , IsEquivalence.refl E.Equiv28/03 17:35
xplathomomorphism has a lambda wrapper to name f and g, but it's probably unneeded28/03 17:36
xplatis there a quick way to abbreviate IsEquivalence.refl X.equiv without prematurely supplying implicit arguments?28/03 17:37
copumpkincould probably make a more flexible export in category28/03 17:38
copumpkinof the three parts of IsEquivalence, parameterized by what we're talking about28/03 17:39
copumpkinand then just use those instead of the equiv record28/03 17:39
xplatit'd be nice to just do C.equiv.refl or something28/03 17:40
copumpkinyeah28/03 17:40
xplati'm not sure it's productive to have a distinction between records and modules to begin with28/03 17:41
xplatscala gets a lot of mileage out of its ability to confuse them in even one direction28/03 17:43
Saizanwhich direction? you can use records as modules in agda, no?28/03 17:45
xplatwell, you can, but it seems to pin down types too much28/03 17:45
xplatyou have to convert the record into a module, and the conversion fills in implicit args28/03 17:46
xplatif you could convert at the use site, it would prevent that from being a problem28/03 17:47
Saizanoh, you mean that you've foo : forall {a b} -> SomeRecordType, and if you do open SomeRecordType (foo) it doesn't push the {a b} -> down to the fields?28/03 17:47
copumpkinyeah28/03 17:48
Saizan(is open what you mean by "convert the record into a module"?)28/03 17:48
xplatdoes it not cause the same problem if you do 'module Foo = SomeRecordType foo' ?28/03 17:49
Saizani guess so, never done that though28/03 17:49
xplatafaiu the place where you supply the SomeRecordType is where the implicit args get bound28/03 17:51
Saizansure, because you've to first apply foo to the arguments to get a record, you can't open a function28/03 17:54
Saizani guess you could open SomeRecordType and then use the projections28/03 17:55
Saizanxplat: or do this http://hpaste.org/45109/records28/03 17:58
copumpkindid y'all see the ridiculous record stuff?28/03 17:58
copumpkinthat NAD posted to the list?28/03 17:59
copumpkinit's like what I was doing a while back, but way better28/03 17:59
copumpkinhttp://www.cse.chalmers.se/~nad/listings/lib/Record.html28/03 17:59
Saizani've been linking that paper around :)28/03 17:59
copumpkinnot to me :'(28/03 18:00
xplathow to type ⊔ ?28/03 18:02
Saizan\lub28/03 18:05
xplatthanks28/03 18:05
Saizan"C-u C-x =" over the symbol tells you, btw28/03 18:06
xplat  Trifunctor : ∀ {o₁ ℓ₁ e₁} {o₂ ℓ₂ e₂} {o₃ ℓ₃ e₃} {o₄ ℓ₄ e₄} → Category o₁ ℓ₁ e₁ → Category o₂ ℓ₂ e₂ → Category o₃ ℓ₃ e₃ → Category o₄ ℓ₄ e₄ → Set (o₁ ⊔ ℓ₁ ⊔ e₁ ⊔ o₂ ⊔ ℓ₂ ⊔ e₂ ⊔ o₃ ⊔ ℓ₃ ⊔ e₃ ⊔ o₄ ⊔ ℓ₄ ⊔ e₄)28/03 18:06
Saizan...28/03 18:07
pumpkin?28/03 18:08
xplatthat is something i ended up making so the type of 'assoc' would not be excessively long ...28/03 18:09
xplati'm not sure where to put it28/03 18:09
xplatargh, where is Category.Functor.assoc getting into my scope?28/03 18:21
xplatah, from Bifunctor ...28/03 18:22
pumpkinyeah, that may have been a bad idea28/03 18:23
pumpkinfunctor is always getting in the way, I find28/03 18:24
xplatwhere would you suggest i put, and what should i call, the obvious function (or bifunctor!) from Functor C₁ D₁ × Functor C₂ D₂ → Functor (Product C₁ C₂) (Product D₁ D₂)?28/03 19:00
xplati replaced Trifunctor with a much simpler Triendo since that was what i actually needed ...28/03 19:02
xplat  Triendo : ∀ {o ℓ e} Category o ℓ e → Set (o ⊔ ℓ ⊔ e)28/03 19:19
xplat  Triendo X = Functor (Product (Product X X) X) X28/03 19:19
xplatfor some reason this seems to fail ...28/03 19:20
xplatoh, right, it fails because i am teh stupien28/03 19:21
xplatit's odd that that did NOT fail at the scoping level, though, it seems weird to allow that particular sort of implicit shadowing28/03 19:23
pumpkinhmm28/03 19:32
pumpkinI'd call it *** :P28/03 19:32
pumpkinbut maybe not28/03 19:32
pumpkinwhy do you uncurry it?28/03 19:33
pumpkinI guess it has a nicer symmetry that way28/03 19:34
jmcarthurman, agda makes programming language implementation almost boringly easy28/03 19:38
pumpkinlol28/03 19:46
pumpkinthen write a fully certified implementation of some programming language!28/03 19:47
xplatpumpkin : maybe i should use the curried form for the function, less symmetric but easier to deal with28/03 19:47
xplatman, Monoidal is *still* reloading28/03 19:54
pumpkinlol28/03 20:01
pumpkinhow long has it been going?28/03 20:01
danris there subscript letters in unicode?28/03 20:07
danrlike subscript n28/03 20:07
xplat... still.  loading.28/03 20:09
pumpkin:O28/03 20:09
pumpkinouch28/03 20:10
pumpkinwell, it's a good test case for profiling agda ;)28/03 20:10
xplatdanr: yes.  it's not a complete set though, or at least it wasn't before unicode 6 afaik28/03 20:10
danrseems to be lacking actually :/28/03 20:11
xplatyou do get n, i, x, and a few others in the 'superscripts and subscripts' block and there are a few more scattered around the phonetic blocks28/03 20:11
xplatsomebody needs to come up with a compact syntax for mathml so as to have a sane data model instead of tex's macro rewriting but still have a reasonably human-editable text form28/03 20:13
pumpkinyeah28/03 20:14
xplatthen there would be no need to worry about superscripts and subscripts in unicode ...28/03 20:14
pumpkinand then I want a good renderer for the nice syntax hooked up to my IRC client28/03 20:14
xplatyes, this is necessary28/03 20:15
pumpkinone with no vulnerabilities, of course28/03 20:15
pumpkinsince I don't want to have to worry about evil people crashing my client28/03 20:15
xplatwrite the core renderer in agda28/03 20:16
xplat(and the parser)28/03 20:16
pumpkinlol28/03 20:16
xplatit can produce display lists which you could pipe through to cairo28/03 20:17
xplator when you want to use screen, it can output unicode with anything necessary that wasn't provided in the private use areas28/03 20:18
xplatit's pretty easy to trawl through unicode property databases for superscripts and subscripts btw, they come with approximate equivalences to the base characters28/03 20:19
xplatand tagged <super> or <sub>28/03 20:20
xplat10 minutes later, still loading28/03 20:21
xplati feel like a tester for the hindley-milner DOS exploit28/03 20:22
xplator else like i'm compiling boost::spirit parsers again28/03 20:22
pumpkinlol28/03 20:22
pumpkinhow much memory is it eating?28/03 20:22
pumpkinare you sharing computation? I think it does make a difference performance-wise28/03 20:22
xplat1363m28/03 20:23
pumpkinnot terrible, I guess28/03 20:23
xplathow do i tell if i'm sharing computation?28/03 20:24
pumpkinI just mean things like saying let x = y in ...28/03 20:24
pumpkinor using a where block28/03 20:24
pumpkinCSE28/03 20:24
xplatoic28/03 20:28
xplatlike replace my Triendo parameterized type in the helper module with a nonparameterized version28/03 20:28
pumpkinhmm, dunno, depends what your code is doing28/03 20:30
xplatwell, i'm using it at least twice at the same parameters28/03 20:33
xplatand it uses Product twice28/03 20:33
pumpkinI dunno how much it actually makes a difference28/03 20:36
xplathm, i killed emacs, but agda, under the name of ghc, is still alive28/03 20:37
pumpkinlol28/03 20:37
pumpkinand the undead shall rise again28/03 20:37
xplatit must be trying to shut down in an orderly way28/03 20:38
xplatthings like this leave me pining for the erlang stdlib28/03 20:39
* xplat kill -9s it and restarts emacs28/03 20:40
pumpkinyou could also try breaking it into smaller units28/03 20:41
pumpkinnot sure how you've structured the code now, but before I had the helper functors28/03 20:41
pumpkinthose could go into a different file somewhere28/03 20:41
xplatloaded28/03 20:41
pumpkinwow28/03 20:42
pumpkinwait, why was it so much faster this time? did you get agda into a loop?28/03 20:42
xplatit may have had something to do with loads that were killed with C-g, or that i worked on several files in the old emacs, or just memory fragmentation28/03 20:43
pumpkinweird, but awesome28/03 20:43
pumpkinare you on github?28/03 20:43
xplatnot yet, i was trying to avoid screwing around with firefox while agda was eating memory like pez28/03 20:44
xplatis there a key to get a record skeleton like the one for case skeleton?28/03 20:44
pumpkinC-c C-r28/03 20:45
pumpkinworks with all sorts of holes28/03 20:45
pumpkinit'll fill in lambdas for you28/03 20:45
pumpkinor records28/03 20:45
xplatawesome28/03 20:45
pumpkinor datatypes where only one constructor fits28/03 20:46
pumpkinor another nice feature is28/03 20:46
pumpkinif you type in the name of a function28/03 20:46
pumpkinit'll fill in a bunch of holes for it28/03 20:46
pumpkinso if f takes 5 parameters28/03 20:48
pumpkinand you type f into the hole, and do C-c C-r28/03 20:48
pumpkinit'll fix f and give you 5 holes28/03 20:48
xplatcool28/03 20:49
xplatokay, now i need *** to go any further28/03 20:49
jmcarthuris agda's slowness and memory footprint fundamental to the theory?28/03 21:05
jmcarthur*to any possible implementation of the theory28/03 21:05
Saizani don't think anyone has come up with lower bounds on the complexity of typechecking agda28/03 21:10
jmcarthuri'd need to read a lot of material to even begin to speculate. my understanding as of now is very abstract (normalize + unify). i don't even know agda's evaluation strategy28/03 21:13
jmcarthur(does it share computations?)28/03 21:14
Saizanit probably tries to do call-by-need, but i'm not sure how successfully28/03 21:15
dantenit uses a kind of call-by-name28/03 21:16
xplatokay, _⁂_ : ∀ {o₁ ℓ₁ e₁ o′₁ ℓ′₁ e′₁ o₂ ℓ₂ e₂ o′₂ ℓ′₂ e′₂} {C₁ : Category o₁ ℓ₁ e₁} {D₁ : Category o′₁ ℓ′₁ e′₁} → {C₂ : Category o₂ ℓ₂ e₂} {D₂ : Category o′₂ ℓ′₂ e′₂} → (F₁ : Functor C₁ D₁) → (F₂ : Functor C₂ D₂) → Functor (Product C₁ C₂) (Product D₁ D₂) finished28/03 21:22
xplatevery foo in the record is either F.foo , G.foo or ⟨ F.foo , G.foo ⟩28/03 21:24
xplatit's too bad C-c C-r doesn't follow the same indenting style as copumpkin (or vice versa)28/03 21:26
xplatpumpkin: is there an identity functor hiding somewhere?28/03 21:30
xplatpumpkin: never mind, found everything i need28/03 22:22
xplatagda-mode starting to slow down again, though :(28/03 22:33
xplatand i haven't even used C-g this time ...28/03 22:34
xplatbut i'm about to!28/03 22:35
xplatwell, now i seem to have yellow terms28/03 23:14
xplatany tips on debugging yellow terms?28/03 23:15
xplatlike, i have ‘x⊗y$⊗z = ⊗ ∘F (⊗ ⁂ idF)’ and ‘∘F’ and ‘⁂’ are yellow28/03 23:17
jmcarthurmy informal strategy so far is to keep stating implicit parameters explicitly until they go away28/03 23:17
xplatthe former missing 3 levels28/03 23:17
xplatthat is going to take a while at the 'speed' agda-mode is going28/03 23:19
xplati was hoping there was another magic keystroke to replace all the implicit parameters with {_} so i could see which ones were still yellow28/03 23:19
xplat_∘F_ is missing only 3 levels, but takes 928/03 23:21
xplati assume supplying implicit parameters requires prefix form ...28/03 23:23
copumpkinxplat: yeah, it needs prefix form28/03 23:49
--- Day changed Tue Mar 29 2011
xplathas anyone done LALR(1) parser combinators in agda?29/03 00:19
xplatholy toledo, the RHS of this function definition needs at least 28 implicit arguments29/03 00:37
xplatno wonder this is so slow29/03 00:38
copumpkin?29/03 00:39
xplatit seems like inferring the implicit arguments would be a source of slowness29/03 00:39
jmcarthur?29/03 00:39
copumpkinxplat: I've noticed that things get a lot slower if there are lots of unsolved metas29/03 00:40
copumpkinbut not so much inferring implicits, but there must be some cost29/03 00:40
jmcarthuri have noticed that implicits tend to cause my memory usage to go up really fast29/03 00:40
copumpkinah, maybe29/03 00:40
jmcarthuri haven't noticed a speed difference from lots of implicits though29/03 00:40
xplati wonder how much this library would speed up if each category were only equipped with one level29/03 00:40
jmcarthurnothing significant, anyway29/03 00:40
copumpkinxplat: I'd hope not much29/03 00:41
xplatjmcarthur: well, a lot of my slowness is probably from swapping, so saving memory would be nice ...29/03 00:41
jmcarthurew29/03 00:41
xplatcopumpkin: writing the declarations would speed up a lot, though29/03 00:41
copumpkinxplat: can't argue with that :)29/03 00:41
jmcarthuronce my laptop starts swapping it becomes useless29/03 00:41
jmcarthurgladd i have 4gb29/03 00:41
copumpkindid you see associativity of horizontal composition in natural transformation?29/03 00:41
jmcarthur*glad29/03 00:41
xplatcopumpkin: that's the next place i'm looking29/03 00:42
copumpkin:)29/03 00:42
copumpkinwhat fo'?29/03 00:42
xplatthe yellow terms i'm trying to debug now are in the type of assoc29/03 00:42
copumpkinoh29/03 00:42
xplatso next i'll need operations on natural transformations to put together the types of the triangle and pentagon laws29/03 00:43
copumpkinwhat operations are missing?29/03 00:44
xplatthey're probably already there29/03 00:44
xplatalthough i might need one or two29/03 00:45
xplatlike i did with ***29/03 00:45
copumpkinI wrote all the ones I could think of, but I don't have much experience29/03 00:45
copumpkinah29/03 00:45
xplatthis laptop only has 2GB29/03 00:48
xplatit's got a T3400, i wonder how much memory the motherboard can take29/03 00:48
xplatwould certainly be helpful having another 2GB if i plan on doing a lot of agda.29/03 00:50
copumpkinxplat: if you need any helpers just tell me which and I can write them while you're doing other stuff29/03 02:25
xplatcopumpkin: well, since i finished filling in those gaps on Friday, i've added 7 lines of code to Monoidal.  and they were pretty much completely pointless.29/03 02:27
copumpkinah :)29/03 02:27
copumpkinwell, if there's anything I can do to help, let me know29/03 02:27
xplati expect to add maybe 10 or 12 more, and they will be both pointless and irrelevant!29/03 02:27
copumpkinhah29/03 02:27
copumpkinor if you don't want to keep doing it, if you put what you've done so far up somewhere I can pull and keep working on it sometime29/03 02:28
xplatno, i kind of do want to keep doing it.  i'll let you know if i find any helpers i need that aren't done yet29/03 02:28
copumpkincool29/03 02:29
xplati figured out that the yellow i got was from not specifying a category for idF29/03 02:30
copumpkinoh, yeah29/03 02:30
copumpkinI need to work out what things always have to be explicit and not make them implicit29/03 02:30
copumpkinsome things that I feel should be inferred don't get inferred because of irrelevance and things29/03 02:30
xplati'm a little surprised it couldn't work out that it was C, but whatever29/03 02:30
copumpkinhence the horrific equality ADT structure in functor, if you've noticed29/03 02:30
xplatyeah, i've kind of glanced at it and quickly looked away.  the horror.  the horror.29/03 02:31
copumpkinit's a combination of the idea behind john major equality and an equivalence relation29/03 02:31
xplatsometime i'll have to spend the sanity points to understand what you did there, i'm sure29/03 02:32
xplatjust saying what you did already makes it clearer29/03 02:32
copumpkindata _≅_ {a} {A : Set a} (x : A) : ∀ {b} {B : Set b} → B → Set where29/03 02:32
copumpkin  refl : x ≅ x29/03 02:32
copumpkinyou seen that?29/03 02:33
xplatyes29/03 02:33
copumpkinyeah, so mine just uses a similar idea on the object mappings of a functor, and requires a proof of equivalence from an equivalence relation on the morphisms, assuming the objects are the same29/03 02:34
copumpkinso you can only construct it if the object mappings are actually identical29/03 02:34
copumpkinvery evil29/03 02:34
xplataha29/03 02:34
xplatSAN cost smaller than i expected.  of course, it always seems that way after you pay >:)29/03 02:35
copumpkinSAN? storage area network?29/03 02:35
copumpkinyou planning very large agda files? ;)29/03 02:35
xplatyeah, i need one for the swapfile29/03 02:36
copumpkinouch29/03 02:36
dolioYou should fill all the extra slots in your computer with RAM disks.29/03 02:46
copumpkinthat'd be nice29/03 03:10
xplatassoc : NaturalIsomorphism x⊗y$⊗z x⊗$y⊗z29/03 03:12
xplatmaybe square brackets would be better than $29/03 03:13
copumpkinyeah29/03 03:14
xplatassoc : NaturalIsomorphism [x⊗y]⊗z x⊗[y⊗z]29/03 03:16
xplatall goals filled, calling it a night29/03 03:16
copumpkinoooh29/03 03:19
copumpkinput it up somewhere? :)29/03 03:19
xplattomorrow, before i start coding again, i'll set it up on github29/03 03:19
copumpkinok :P29/03 03:20
xplatone thing i've noticed about agda: even if you write pointfree at the value level there tend to be a lot of points in the signatures29/03 12:40
xplata lot of times this is what you want anyway, but i wonder what you can do when it isn't?29/03 12:45
dolioThat's kind of unavoidable if the points come from pi.29/03 12:45
dolioAnother issue is that you sometimes have to add points to please the termination checker.29/03 12:47
dolioActually, that's probably wrong.29/03 12:50
dolioBut, you can't use nice combinators.29/03 12:50
doliofoo (C x) = bar . baz . foo $ x29/03 12:50
dolioThat won't be accepted by the checker.29/03 12:51
xplatthe termination checker doesn't understand function composition well enough to consider that structural recursion because the foo is combined with bar and baz before being applied to x?29/03 13:08
xplatbut foo (C x) = bar . baz $ foo x would work, right?29/03 13:09
dolioRight.29/03 13:12
dolioI think functions are essentially opaque to the termination checker in that regard.29/03 13:15
dolioIt looks like foo (C x) = f foo x, and you wouldn't accept that for arbitrary f.29/03 13:15
copumpkinI've often had to eta expand something29/03 14:33
copumpkineven non-implicit29/03 14:33
copumpkinto make it typecheck without yellow29/03 14:33
xplathm, speaking of point-free style it looks like a lot of things in the CT library don't have the right argument order for currying ...29/03 14:57
xplat(in the informal sense)29/03 14:58
copumpkinyeah, wasn't a consideration at all when I was writing it :P29/03 14:58
copumpkinbut I'd like it to be29/03 14:58
copumpkinreordering arguments is more of a pain in agda since you can't put things that depend on other things before them29/03 15:00
copumpkinbut there are still a lot of dumb orders I use29/03 15:00
xplatwell, it seems nice to put all the levels first, then the categories, then the functors.  until you want to curry.29/03 15:24
xplatcopumpkin: github.com/xplat/categories29/03 16:00
xplat“Selinger discusses autonomous, balanced, braided, compact closed, pivotal, ribbon, rigid, sovereign, spherical, tortile, and traced monoidal categories.” -- i probably won't implement all of these ... :)29/03 16:11
xplat  open NaturalIsomorphism identityˡ using (F⇒G) renaming (F⇒G to υˡ)29/03 16:41
copumpkinexcellent! thanks29/03 16:42
xplatthis seems to fail29/03 16:42
copumpkinat work now but I'll check it a bit later29/03 16:42
copumpkinrenaming uses it29/03 16:42
xplatso what do i want to do, 'using ()'?29/03 16:42
copumpkinyeah29/03 16:42
xplati guess that's actually better for DRY29/03 16:43
copumpkinholy shit that's an awesome symbol you used in product29/03 16:44
copumpkintri asterisk?29/03 16:44
xplat\asterisk329/03 16:44
copumpkinawesome29/03 16:44
xplatunicode calls it ASTERISM29/03 16:45
copumpkincool29/03 16:45
copumpkinactually waiting for a colleague now, so I might as well try and merge it29/03 16:46
copumpkinI'm typechecking everything.agda, then will push29/03 16:49
copumpkinso in half an hour or so :P29/03 16:49
copumpkindoes monoidal still take ages to typecheck?29/03 16:59
copumpkinor did it go down once you fixed yellow?29/03 16:59
copumpkinyay, it built29/03 17:07
copumpkinokay, it's all up on github now29/03 17:09
xplatnifty.  i just wrote _⁂ⁿ_ which lifts the action of _⁂_ to NTs29/03 17:42
jmcarthur...29/03 17:43
jmcarthurunicode is crazy29/03 17:43
xplatso if α : F₁ ⇒ G₁ and β : F₂ ⇒ G₂ then α ⁂ⁿ β : F₁ ⁂ F₂ ⇒ G₁ ⁂ G₂29/03 17:46
joe6is there something like this: allToys = [minBound .. maxBound]29/03 17:47
joe6or, is there a way to list out all the constructors of a set?29/03 17:48
joe6http://pastebin.com/8YLEawMS , this is my source file that I am converting from haskell to agda.29/03 17:49
joe6I am trying to use the enum functionality in agda? Just wondering if there is something similar, as I could not match on much when grepping the stdlib src for "enum"..29/03 17:50
joe6would it be an "indexed list"?29/03 17:57
joe6i see this in the agda src, "Agda/examples/outdated-and-incorrect/DTP08/conor/SomeBasicStuff.agda:data Enum (ts : Enumeration) : Set where"29/03 18:00
xplatalmost done with the triangle29/03 19:00
xplator so i hope29/03 19:00
xplatalready swapping on the first load :(29/03 19:03
xplatthis is ridiculous, i need more RAM29/03 19:05
starcloudedhello everybody29/03 19:06
xplati haven't even got close to the actual hard part yet, which would be the coherence theorem29/03 19:13
joe6xplat, do you know how to simulate a type synonym in agda?29/03 19:21
joe6i meant "use" a type synonym..29/03 19:22
joe6something as "type leftToys = List Toy"29/03 19:23
joe6of haskell29/03 19:24
djahandariejoe6, it's much nicer in Agda :)29/03 19:24
djahandarieIt doesn't even need any special syntax29/03 19:24
djahandarieYou bind a type to a name just like you bind a variable to a name29/03 19:24
djahandarieErm, s/variable/value/29/03 19:24
joe6djahandarie, using implicit arguments?29/03 19:26
joe6djahandarie, any sample, please?29/03 19:27
joe6djahandarie, or is it" Ctx = List Type"29/03 19:27
joe6something like that? let me try..29/03 19:28
xplatCtx : Set ; Ctx = List Type29/03 19:29
copumpkinyou don't even need to annotate the type29/03 19:30
joe6xplat, thanks.29/03 19:30
joe6that was easy..29/03 19:30
jmcarthurand i see what you're doing, too ;)29/03 19:31
jmcarthuralso something that agda makes really easy29/03 19:31
xplattype synonyms are just ordinary variables/functions29/03 19:31
xplatand you don't just get plain synonyms that way, you get power similar to type families29/03 19:31
jmcarthurclosed type families29/03 19:32
xplat(actually, they are type families, in an older and slightly different sense than the one haskell uses)29/03 19:32
copumpkinyou can't pattern match on types29/03 19:32
copumpkinwithout universes29/03 19:32
jmcarthurAKA universes?29/03 19:32
copumpkinand even those aren't pattern matches on universes29/03 19:33
xplatjmcarthur: i said power similar, not power the same as29/03 19:33
jmcarthuryeah i was just clarifying29/03 19:33
xplatalthough actually you need data families to have the full degree of power in haskell29/03 19:33
jmcarthurdata families are really cool29/03 19:34
xplat(only data families are injective and hence can be matched on)29/03 19:34
jmcarthurhmm... dependent data families...29/03 19:35
copumpkinwe still can't match on types :P29/03 19:35
xplat(*injective and mutually disjoint)29/03 19:35
djahandarieData families are something I tend to not use in Haskell for some reason29/03 19:39
djahandarieI haven't haven't felt like I've had a use for them29/03 19:39
copumpkinI find myself using GADFs a decent amount29/03 19:40
jmcarthuri've used data families quite a bit29/03 19:40
copumpkinGADTs + data families, that is29/03 19:40
djahandarieMaybe I should make myself use them some time to get the right feel for it29/03 19:41
jmcarthurwell, hard to make yourself use something when you are used to what it's good for29/03 19:41
jmcarthurstudy existing uses of them, maybe. e.g. vector's Unbox stuff, memotrie, etc.29/03 19:42
djahandarieAll I've done is read the wiki page on them, probably if I actually use it I'll get the right feel29/03 19:44
xplatif you consider TFs as FDs made simple, then DFs are basically bidirectional FDs made simple29/03 19:44
copumpkinnot quite bidirectional FDs in general though29/03 19:45
xplatrefining this goal is really taking a long time29/03 19:52
copumpkinyou need a bigger refinery29/03 19:53
xplati must sound like a broken record29/03 19:53
copumpkinNeed More Ore!29/03 19:53
copumpkinxplat: does your laptop support more memory? memory is pretty cheap these dys29/03 19:54
xplatneed a 2^16x2^16 crafting table29/03 19:54
xplatwell, the good news is it looks like it can go up to 4GB.  the bad news is, looks like that will max it out so if that's not enough i'm hosed.29/03 20:04
copumpkinI do most of my development on a 4gb laptop29/03 20:05
xplatnow the question is, do i have my existing ram as 1 stick or 2?29/03 20:07
xplatkind of sucks if it's 2 and i want to max it out, but they probably did 2x1GB :I29/03 20:08
copumpkinyeah, they often do29/03 20:12
xplatnow do i want to buy it today, or get it by mail order and suffer for a week?  i guess the prices seem pretty comparable in this case ...29/03 20:22
joe6it appears that the \circ of agda-utf8.vim is not the compose character. Shouldn't it be?29/03 20:48
joe6what is the equivalent of this in agda: buildTree _ _ _ = error "unknown combination"29/03 20:51
xplathave a type that doesn't allow unknown combinations29/03 20:52
xplatfailing that, use maybe or either -- error isn't usually a good idea even in haskell29/03 20:53
joe6xplat, thanks. makes sense..29/03 20:57
joe6i am trying to implement ==,  Buzz   Woody   Rex   Hamm : Toy29/03 21:28
joe6_==_ : Toy → Toy → Bool29/03 21:28
joe6( x ) == ( x ) = true _   ==   _   = false29/03 21:28
joe6( x ) == ( x ) = true; _   ==   _   = false29/03 21:28
Saizanyou can't repeat variables like that29/03 21:29
Saizani.e. to implement that _==_ you have to do it like in haskell, with 5 cases29/03 21:29
joe6Saizan, ok, thanks.29/03 21:30
xplatthe only functional language i know off the top of my head where you can do that repeated-variable thing is erlang29/03 21:32
xplatand that's because it started out as a thin functional wrapper over prolog29/03 21:32
xplatit still has a lot of other similarities to prolog too, like it optimizes tail calls the same way as the WAM29/03 21:34
xplat(which is very efficient for doing explicit state passing in long argument lists, which in turn is a common pattern in prolog)29/03 21:35
joe6  _   ==   _   = false , can I do something like this?29/03 21:42
joe6i listed all the other cases, but for the last one, I had something like this.29/03 21:42
Saizanthat's ok29/03 21:43
joe6Parse error =<ERROR> false delete : Toy → List To...29/03 21:43
Saizansounds like an indentation problem29/03 21:44
joe6Saizan, yes thanks. that fixed it.29/03 21:46
joe6I had "  _ == _ = false" instead of "_ == _ = false" (notice the space in the beginning).29/03 21:47
joe6.29/03 21:47
joe6is it possible to define data definitions where the datatypes are dependent on each other? something as "mutual data AD (B : BD) : Set where a : B -> AD; data BD (A : AD) : Set where b : A -> BD;"29/03 22:09
joe6the actual datatype definition is: http://pastebin.com/ixv07RM529/03 22:09
joe6i tried a record in mutual, but that did not work..29/03 22:09
joe6Saizan, any thoughts, please?29/03 22:12
Saizanyou can use Forwards and Backwards as types29/03 22:13
joe6Saizan, this is what I ended up with: http://pastebin.com/xhyJ2kNf29/03 23:01
danrjoe6: just jumping in here, if you write List Tree where you've written Backwards and Forwards, you don't need mutual anymore (and you can define Backwards and Forwards afterwards instead)29/03 23:05
danrbut I don't see really what you're trying to do29/03 23:05
danrI usually don't have toys in my trees :)29/03 23:05
--- Day changed Wed Mar 30 2011
xplatcopumpkin: i created a &&&-equivalent and a Constant functor30/03 00:19
xplati'm not nearly as happy with the symbol i chose this time -- not only does it break the triple theme, but it rejoices in the abbreviation '\textreferencemark'30/03 00:20
xplati couldn't find anything with three &s or commas, though30/03 00:21
starcloudedhello everybody30/03 00:40
joe6danr, thanks. let me try to put the whole thing together and will it run it by you.30/03 00:41
joe6starclouded, hello.30/03 00:41
starcloudedanyone knows about some article about an approach of functional programming with topological spaces?30/03 00:57
copumpkinxplat: lol, nice30/03 01:39
xplatcopumpkin: almost finished with Triangle, actually i think it is finished but i had to leave before i could load it30/03 02:17
copumpkincool!30/03 02:17
xplati discovered something annoying, though30/03 02:18
xplatyou can't recover the cartesian product structure from a Product C D, so type information on _※_ and _⁂_ can only ever flow upward from arguments to result and never vice versa30/03 02:19
xplatalso, on the constant functor, an object doesn't know which Category it's an object of so you basically need the implicits for the destination category filled pretty often.  (and the source, but that i expected to begin with...)30/03 02:20
xplater, the implicit for the codomain category explicitly filled30/03 02:21
copumpkinah30/03 02:22
copumpkinif you're always going to have to specify an implicit, you might as well make it explicit30/03 02:22
xplatyeah, well you don't always need them if you already specified a signature for something that has them outermost, or if you combine them using ∘30/03 02:24
xplat∘ is, and the similar composites for NTs are, pretty good at moving type information up, down and sideways, because things are exact matches30/03 02:25
xplatoh!  i realized something else, and it's not annoying30/03 02:26
xplatyou know how you have <_,_> (can't find those darned angle brackets)?30/03 02:29
xplatand you could easily generalize that to <_,_,_> and <_,_,_,_> and so on?30/03 02:29
xplatwell, what happens if you generalize it as far as a dependent product?30/03 02:30
xplatyou get ((x : A) -> (y: B x) -> C x)) -> ((x : A) -> (y : B x)) -> (z : A) -> C z30/03 02:34
xplatthat's kind of a cool type30/03 02:37
xplatand you can even make it slightly more dependent30/03 02:38
xplat(g : (x : A) -> (y : B x) -> C x y) -> (f : (x' : A) -> (B x)) -> (z : A) -> C z (f z)30/03 02:40
xplatit's basically a more dependent version of bind for Reader30/03 02:41
xplat(Reader A, that is)30/03 02:41
copumpkinoh30/03 02:42
copumpkinneat :)30/03 02:42
nappingI'm not quite sure how irrelevant arguments are supposed to work30/03 02:42
nappingit would be bad if you could subst by .(x \== y), wouldn't it?30/03 02:43
copumpkinI don't think you can do much with them except stick them into irrelevant things?30/03 02:43
dolioYes.30/03 02:43
nappingyou can refute them30/03 02:43
copumpkinhmm, haven't played with them much30/03 02:44
nappingthough it seems you need a function of type .\bot \r \bot if you want to construct the absurdity in a with clause30/03 02:44
nappingother than that, it doesn't seem like you can do too much30/03 02:44
nappingthough perhaps I should ask the list if there's any reason besides newness not to define Dec P where yes : P -> Dec P; no : .(\neg P) \r Dec30/03 02:45
nappingwith the advantage that Dec P will have a single proof as long as P does30/03 02:45
xplatand if you do it with &&&, you get flip : ((x : A) -> (y : B) -> C x y) -> (y' : B) -> (x' : A) -> C x' y'30/03 02:45
nappinghmm, actually for the development I was doing I had, I was using an inequality proof directly30/03 02:46
joe6what is the "less than sign"?30/03 02:46
copumpkin< ?30/03 02:46
joe6solution = filter (λ < cost , _ > → cost < 61)30/03 02:46
copumpkinoh30/03 02:46
copumpkinthat's mixfix30/03 02:46
copumpkin< _ , _ >30/03 02:46
nappingdoes M-. work?30/03 02:46
copumpkinoh, which do you mean?30/03 02:47
copumpkinthe < there is probably x < y = suc x <= y30/03 02:47
nappingif you point the cursor at one of the symbols, and push M-., does it go to a reasonable definition?30/03 02:47
copumpkinI dunno about M-., but my left control key does a great job at it30/03 02:47
joe6Don't know how to parse cost < 61. Could mean any one of:30/03 02:48
joe6 cost < 6130/03 02:48
joe6  (cost <) 6130/03 02:48
joe6when scope checking cost < 6130/03 02:48
copumpkincan I see the source?30/03 02:49
nappingseems like M-. does work pretty nicely30/03 02:49
joe6copumpkin, sure. give me a sec.30/03 02:49
nappingmaybe a bit too well, even - at the \> of an \==-Reasoning bracket, it went straight to \~=\<_\> in PreorderReasoning30/03 02:50
joe6copumpkin, http://pastebin.com/s9n6E6nS30/03 02:50
joe6i am trying to do the "exercise in logic programming of zug" in  agda.30/03 02:51
copumpkinnapping: yeah, it's very smart30/03 02:51
copumpkinjoe6: where do you get Data.Tuple from?30/03 02:52
joe6copumpkin, it was in the agda darcs repo, it is http://pastebin.com/3igwCsSs30/03 02:53
copumpkinoh, weird30/03 02:53
copumpkinI wouldn't use that stuff, for what it's worth30/03 02:53
copumpkinbut30/03 02:53
copumpkinI think the issue is that that constructor doesn't have a fixity declaration on it30/03 02:54
copumpkintry saying something like infix 4 <_,_>?30/03 02:54
copumpkinor actually30/03 02:54
copumpkinit's not infix, is there another notation for it?30/03 02:54
joe6i will use the fst then.30/03 02:55
xplatand let's see, dependent +++ is: (x : A) -> (y : B x) -> C x) -> Σ (x' : A , y' : B x) -> Σ (x'' : A , z : C x' y')30/03 02:56
xplater, sorry30/03 02:56
xplatdependent +++ is: ((x : A) -> (y : B x) -> C x) -> Σ (x' : A , y' : B x) -> Σ (x'' : A , z : C x'')30/03 02:57
dolioWhat is +++?30/03 02:57
xplatf +++ g = either (Left f) (Right g)30/03 02:58
dolioAh.30/03 02:58
dolioAnyhow, that's a special case of bimap for sigma.30/03 02:58
doliobimap id30/03 02:58
dolio(f : A -> B) -> (g : (x : A) -> C x -> D (f x)) -> Sig A C -> Sig B D30/03 02:59
xplatah, yeah, that sounds pretty handy, reshaping the sum at the same time30/03 03:01
joe6copumpkin, C-c C-d on  (fst ( < 0 , 0 > )) < 10 says Set and not Bool?30/03 03:01
joe6copumpkin, is it because of the Data/Tuple using < bracket?30/03 03:03
copumpkinjoe6: hmm, no30/03 03:06
copumpkin< doesn't return a Bool30/03 03:06
copumpkinor shouldn't30/03 03:06
copumpkinBool is almost useless for most things30/03 03:06
copumpkineven in Haskell I try to avoid using it30/03 03:06
copumpkinusually when checking whether something satisfies a property, you can return a bit more information about whether it satisfies it or not30/03 03:07
copumpkinin this case, you probably want something like <?30/03 03:07
copumpkinnot sure if there is one30/03 03:07
copumpkinbut that returns a "fancy Bool"30/03 03:07
xplatdependent-||| : ((x : A) -> (y : B x) -> C x y) -> Σ (x' : A , y' : B x) -> C x' y'  -- dependent uncurry30/03 03:07
copumpkinit's what napping was talking about before30/03 03:07
dolioxplat: Works better if C takes a sigma.30/03 03:09
xplatdolio: ah, makes sense30/03 03:09
dolioMatching on the sigma in the type isn't possible in most of the languages I've seen.30/03 03:09
xplatprobably won't find C like that in the wild though :(30/03 03:10
* copumpkin tries to decide what to implement next in the library30/03 03:10
joe6copumpkin, how do you test if something is less than 61?30/03 03:13
copumpkinwith the fancy bool I mentioned30/03 03:14
copumpkinDec30/03 03:14
copumpkinit has two constructors, yes, and no30/03 03:14
copumpkinnot sure if it's in the weird library you're using30/03 03:14
dolioxplat: You can either have dependent uncurry uncurry C, or uncurry things you pass to it.30/03 03:14
copumpkinand yes carries a proof that the statement is true, and no carries one that it isn't true30/03 03:14
joe6copumpkin,  i just found the tuple in that library. I am using the usual std lib30/03 03:14
copumpkinjoe6: oh okay30/03 03:15
joe6copumpkin, what is Dec?30/03 03:15
copumpkinRelation.Binary.Decidable iirc30/03 03:15
joe6ok, will check that.30/03 03:15
dolioIf you do the latter, universe polymorphism potentially kicks in, making type-uncurry a special case of universe polymorphic uncurry.30/03 03:15
copumpkinhttp://www.cse.chalmers.se/~nad/listings/lib/Relation.Nullary.Decidable.html#130/03 03:16
copumpkinoh wait not that30/03 03:16
copumpkinI guess it is re-exported from there30/03 03:16
copumpkinhttp://www.cse.chalmers.se/~nad/listings/lib/Relation.Nullary.Core.html#1 is the definition30/03 03:16
xplatdolio: i'm having a little trouble following that30/03 03:16
copumpkinjoe6: then you'll want _≤?_ : Decidable _≤_30/03 03:17
copumpkinor maybe even compare : ∀ m n → Ordering m n30/03 03:17
joe6copumpkin, can you please help me on how to use it?30/03 03:18
dolioxplat: uncurry : ... -> {C : Sig A B -> Set i} -> ((x : A) -> (y : B x) -> C (x, y)) -> (p : Sig A B) -> C p30/03 03:18
copumpkinyou definitely need < and not <= ?30/03 03:18
joe6copumpkin, i saw the ordering but cannot figure out how to use it..30/03 03:18
dolioFor C = const Set, you get:30/03 03:18
joe6copumpkin, i can use either.30/03 03:18
dolio((x : A) -> B x -> Set) -> Sig A B -> Set30/03 03:18
copumpkinjoe6: it's like compare in haskell. It tells you if something is less than, equal, or greater than something else30/03 03:18
joe6copumpkin, i can even use > or >= too ..30/03 03:19
copumpkinah okay30/03 03:19
copumpkinthen _≤?_ is probably best30/03 03:19
dolioWhich takes a curried C and makes something appropriate for use with uncurry.30/03 03:19
xplatdolio: oh, cool30/03 03:20
xplatand then you can make uncurry' which uncurries C by itself and have the flexibility to choose between convenience and flexibility :)30/03 03:20
nappingThis terminal does not like unicode30/03 03:21
joe6copumpkin, where is that symbol? I cannot find it Relation.Nullary.Core or Relation.Nullary.Decidable30/03 03:22
copumpkinit's in Data.Nat30/03 03:22
joe6copumpkin, ok, thanks.30/03 03:22
copumpkinyou're going to need to use a with block30/03 03:23
joe6copumpkin, isn't it a bit much for a simple compare operation?30/03 03:27
copumpkinyou can forget the proofs to get a bool, but you can't get the proofs from a bool30/03 03:29
copumpkinthe point is that a bool doesn't really get you much at all30/03 03:30
copumpkinassuming you care about certifying things about your program30/03 03:30
copumpkinthere's a reason we use `Maybe a` in haskell instead of `(Bool, a)`30/03 03:31
dolio(Bool, a) is a poor representation.30/03 03:32
joe6copumpkin, oh, ok.30/03 03:32
dolioIf you had dependent types, you could use Sig 2 (1 ? a).30/03 03:32
dolioOf course, that's exactly Maybe a.30/03 03:32
joe6copumpkin, can you please let me know where I can find a sample code for a compare operation? I cannot seem to find something from google.30/03 03:33
copumpkinoh30/03 03:33
copumpkinhttp://www.cse.chalmers.se/~nad/listings/lib/Data.Nat.html#320130/03 03:33
copumpkinthe source code of that function calls itself30/03 03:33
joe6copumpkin, i have not used decidable before and hence am not sure how to use it..30/03 03:33
copumpkinyou'll want to write a with block like that30/03 03:33
joe6copumpkin, i have to figure out what that code does. ok, thanks.30/03 03:37
copumpkinwith basically lets you pattern match on something you didn't get passed in30/03 03:37
copumpkinan arbitrary expression30/03 03:37
copumpkinxplat: mind if I do cartesian, or are you doing that?30/03 03:51
xplatcopumpkin: feel free30/03 03:52
joe6i am trying to write an agda program the "zug logic programming exercise" (http://web.engr.oregonstate.edu/~erwig/zurg/). This is what I have: http://pastebin.com/8nApsvmJ , agda. The haskell source that worked for me was: http://pastebin.com/GTdM0nuJ . When I compile the source, agda gives me these messages:  http://pastebin.com/9Dd5fCE430/03 04:06
joe6just wanted to know what those messages signify..30/03 04:07
joe6yellow highlighting of all _$_ ..30/03 04:13
nappingthat means there is an implicit argument that isn't inferred30/03 04:25
joe6napping, oh, ok. replaced all the $ with the parenthesis and it seems to fix those issues.30/03 04:28
joe6napping, what does the orange highlighting of some terms signify?30/03 04:28
joe6napping, background color, I meant.30/03 04:29
nappingI think that's what you get if termination checking fails30/03 04:30
nappingis it on a recursive function?30/03 04:30
joe6napping, i had a wildcard matching at the end of those functions too?30/03 04:32
nappingit's a different color30/03 04:32
joe6napping, yes, they are recursive functions.30/03 04:32
nappinga recursive function turns red if it doesn't obviously terminate30/03 04:32
joe6napping, this is basically a one-to-one translation from haskell to agda, which works on agda. Would you please comment on how I can convert it to Agda using agdas' unique features? http://pastebin.com/tNvkz2zU30/03 04:38
joe6napping, add more agda-specific features that will help me explore and understand agda further..30/03 04:42
joe6jmcarthur, any thoughts on adding more agda functionality to this program, please? http://pastebin.com/tNvkz2zU30/03 04:43
copumpkinI find myself longing for the "late binding" behavior xplat was talking about for opening modules30/03 06:15
joe6copumpkin, any thoughts on how I can add more agda features to this program, please? http://pastebin.com/6J2uuQVh30/03 06:42
copumpkinjoe6: start learning proofs30/03 06:43
joe6copumpkin, i am trying to implement the "Escape from Zurg: logic programming" in agda. It is more of a translation from haskell, at this point.30/03 06:43
joe6copumpkin, any suggestions on how I can do that, please?30/03 06:44
copumpkinthe usual agda tutorialpdf30/03 06:45
copumpkinhttp://www.cse.chalmers.se/~ulfn/papers/afp08/tutorial.pdf30/03 06:46
joe6copumpkin, how do I ensure termination of recursive functions for the agda termination checker? Any suggestions, please? all my recursive functions have a background colour of brown.30/03 07:30
copumpkinthey need to "eat" a constructor30/03 07:30
joe6copumpkin, http://pastebin.com/je47a2Nr30/03 07:30
copumpkincombinationsOf k (x ∷ xs) = map (_∷_ x) (combinationsOf (k ∸ 1) xs)30/03 07:31
copumpkinthat k - 1 isn't obviously smaller30/03 07:31
copumpkinyou want to use (suc k)30/03 07:31
copumpkinand write k30/03 07:31
joe6copumpkin, got u. Thanks a lot.30/03 07:31
joe6copumpkin, i am using a custom function called delete to remove values from a parameter (which is a list). Any suggestions on how I can convert that into a "eat" of a parameter?30/03 07:39
joe6i cannot use ( x :: xs) as i am not sure where in that list the x could be..30/03 07:40
copumpkinyou're using filter, what's wrong with that?30/03 07:41
joe6copumpkin, is it wrong to use filter?30/03 07:43
copumpkinfilter is already safe30/03 07:44
joe6copumpkin, i am writing a program, not testing a proof.. though, I want to learn about formal verification and how I can use that for programming.30/03 07:45
joe6copumpkin, i was using agda to figure out a shortest-time solution.30/03 07:45
joe6copumpkin, using depth first trees..30/03 07:46
joe6copumpkin, am I talking nonsense? or, did that answer your question..30/03 07:47
copumpkinyou're starting with stuff that's too hard :P30/03 07:48
copumpkinit's hard enough to prove really simple stuff30/03 07:48
copumpkinI'd read that PDF I linked you to30/03 07:48
copumpkinyou really can't just write the program you'd expect to write in another language and magically prove stuff about it30/03 07:48
copumpkineven if the other language is haskell30/03 07:49
joe6copumpkin, my primary objective is to use the dependent types for programming as they seem to help with the program structure. Adding proofs is somethng that I would like to learn as time passes.30/03 07:49
joe6copumpkin, and to use agda as a programming tool and add in proofs as I keep learning. More like, using agda instead of haskell for my programming needs.30/03 07:51
joe6copumpkin, not as a specialised proof-checker..30/03 07:52
copumpkinfair enough, but I don't think many people have done that before :) I never run my agda code30/03 07:53
copumpkinnor do most people here30/03 07:53
joe6copumpkin, i like the ability to use constructors in type signatures.30/03 08:05
joe6copumpkin, i feel that it makes the program easier to read/structure30/03 08:05
copumpkinyeah, I agree30/03 08:12
copumpkinbut you also sacrifice a lot that haskell gives yhou30/03 08:12
joe6copumpkin, it appears that the intermingling of types and values and the ability to specify conditions on types, is the next forward step from Haskell.30/03 08:14
copumpkinpossibly30/03 08:34
copumpkinxplat: I've made it a hell of a lot more pleasant to use a category with binary products30/03 08:35
copumpkinI might start adding convenience methods a lot more to save myself from having to open modules and not have module opening unnecessarily restrict types30/03 08:35
copumpkinI also have a lot of cartesian done now30/03 08:36
Saizani want built-in support for ornaments.30/03 15:52
pumpkinoh, à la conor?30/03 16:10
pumpkinnot to be confused with à la conor's à la30/03 16:10
Saizanheh30/03 16:10
Saizanyes30/03 16:10
pumpkinby the way, does anyone see any reason for opening specific modules to not bind the parameters until later? duplicated computation maybe?30/03 16:13
Saizanhttp://code.haskell.org/~Saizan/fooling/Check.agda <- i think i could easily squeeze this proof in half with them30/03 16:13
pumpkinit'd be nice to have the option30/03 16:13
pumpkinSaizan: development seems to have slowed down on agda this past couple of months, as far as I can tell?30/03 16:14
pumpkinI dunno30/03 16:14
Saizanon epigram, you mean?30/03 16:15
pumpkineven agda, I thought30/03 16:16
pumpkinwell, there have been times several days apart when I pulled from the repo and there were no changes30/03 16:16
pumpkinbut maybe I was just unlucky30/03 16:16
Saizanit's not been very active, though maybe they were busy writing for ICFP? also last AIM wiki said somethinb about Ulf no longer getting paid for it?30/03 16:18
pumpkinoh damn30/03 16:19
Saizananyhow, about modules, i think it's just a consequence of not having automatic generalization anywhere30/03 16:20
pumpkinI see30/03 16:21
dolioWhat does the module question mean?30/03 16:21
pumpkindolio: if I do open R someRValueWithImplicits30/03 16:21
pumpkinit'll be yellow30/03 16:21
pumpkinthen I use some of the exported stuff from R30/03 16:21
pumpkinit'll stop being yellow, as the use site of the exported stuff from R has fixed the implicits30/03 16:22
pumpkinbut now if I use that stuff again, it must be using the same implicits30/03 16:22
dolioOh.30/03 16:22
pumpkinthe other option would be to "pass them on" to the individual exported thigns30/03 16:22
pumpkinand it's one that I vastly prefer30/03 16:22
dolioThat's probably tricky to get right.30/03 16:23
pumpkinprobably. I've been doing it manually for binary products and it's just the behavior I wanted, but it involves a lot of duplication of definitions30/03 16:23
dolioIt means that f : A -> B, x : {C} -> A |- f x : {C} -> B, essentially.30/03 16:24
dolioUnless you only want it to happen with modules or something.30/03 16:24
dolioAnyhow, I'm fully prepared to agree with Conor that implicit arguments are a complete mess.30/03 16:25
dolioThat is, having implicit arguments be genuine constructs in your language.30/03 16:25
dolioNot just in Agda, but in general.30/03 16:26
Saizani think it's be more akin to x : {C} -> Sigma A B |- proj1 x : {C} -> A, proj2 x : {c : C} -> B (proj1 x {x})  -- if you allow me two consequents30/03 16:29
djahandarieImplicit arguments are a mess? Aren't they kind of core to making things work in Agda nicely?30/03 16:29
Saizani guess that's what happens with your rule for f = proj1 or proj230/03 16:30
dolioThey're core to letting you write stuff like 'id x' instead of 'id A x' or 'id _ x'.30/03 16:30
djahandarieYeah, that's kind of what I mean by 'nicely'30/03 16:31
djahandarieThey make it easier to intuit about certain things I guess30/03 16:31
Saizanthe idea is that you don't need a special function space just to support that kind of syntax sugar30/03 16:31
dolioSaizan: And yes, I think it's a special case.30/03 16:32
pumpkinwhat annoys me most often is having to eta-expand implicits30/03 16:32
pumpkindolio: I'm trying to find a good way to reuse all the proofs about products I stole from you when building cartesian monoidal categories30/03 16:34
pumpkinit's kind of a pain :/30/03 16:35
dolioI mean, if we desugar the rule, it means that we want 'f x' to be interpreted as '\v -> f (x v)'.30/03 16:35
dolioPerhaps you can hand-wave about generalized elements.30/03 16:37
doliox : A is really x : {()} -> A30/03 16:37
dolioAnd then that definition of application is the one you get for desugaring application into composition in a category.30/03 16:37
dolioBut I don't really think that's a good idea.30/03 16:38
dolioYou also have problems when f : ({C} -> A) -> B, if I'm not mistaken.30/03 16:40
doliof x may be yellow there, too.30/03 16:40
dolioThat's where you eta expand, no?30/03 16:40
Saizanopen R foo is sugar for module M = R foo; open M; maybe we can just make module M = .. perform HM-style generalization?30/03 16:40
Saizandolio: yeah, you almost always need to eta expand there30/03 16:41
Saizani'd like to know why in some cases you don't30/03 16:41
dolioAnyhow, that implicit arguments fail to handle that higher order case is kind of a significant problem.30/03 16:45
dolioThat'd be like rank-n types failing to work in GHC unless you added annotations.30/03 16:46
Saizan..which happens, though not this often30/03 16:47
dolioIt seems that the problematic case is when you have {x : A} -> B instead of {x : A} -> B x.30/03 16:49
dolioI guess the dependency in the latter is enough to determine what gets filled in.30/03 16:49
doliof v => f (\{x} -> v _)30/03 16:50
dolioIt somehow reasons that since v _ : B x, _ = x must be filled in.30/03 16:51
dolioI guess it's difficult to come up with an analogue for the former case in GHC, because no one uses types like 'forall a. Int'.30/03 16:53
pumpkin> 1 :: forall a. Int30/03 16:54
lambdabot  130/03 16:54
Saizanand B has to be injective or constructor headed, even30/03 16:54
dolio> let f :: (forall a. Int) -> Int ; f x = x ; v :: forall a. Int ; v = 1 in f v30/03 16:55
lambdabot  130/03 16:55
pumpkinhttp://www.cis.upenn.edu/~byorgey/papers/binders-unbound.pdf seems like it'd be fun in agda30/03 16:59
pumpkinor something like it30/03 16:59
byorgeypumpkin: I agree!30/03 16:59
pumpkin:)30/03 16:59
starcloudedhello everybody30/03 17:04
pumpkinhi30/03 17:05
starcloudedanyone knows about some article about an approach of functional programming with topological spaces?30/03 17:07
Saizanhttp://homotopytypetheory.org/references/ <- this stuff?30/03 17:09
joe6Saizan, any suggestions on how I can add more agda functionality to this code? http://pastebin.com/qvmvgk2P30/03 17:12
joe6Saizan, I was trying to solve the "Escape from Zurg: Exercise in logic programming" using agda.30/03 17:13
joe6i am working on the recursive functions failing termination and am trying to make them "eat" the constructors.30/03 17:14
joe6Saizan, but, am not sure what more agda features will help make the program better?30/03 17:15
Saizanjoe6: you could use more indexed families to encode more information into your types maybe, though i'm not familiar with the exercise, so i don't know what30/03 17:20
joe6Saizan, thanks, I wll try that. Any more suggestions like that would be helpful in giving me a direction learn and explore. (btw, if you are interested, here is the paper regarding this exercise http://web.engr.oregonstate.edu/~erwig/zurg/ )30/03 17:24
joe6in the Data/Nat.agda, what does the data __ : Rel ℕ zero where30/03 17:30
joe6what does the "Rel N zero" mean?30/03 17:30
joe6it seems to be used for all the compare operators.30/03 17:30
Saizanit expands to N -> N -> Set zero30/03 17:30
joe6an inductive type on 2 elements?30/03 17:31
SaizanRel A l = A -> A -> Set l; Rel stands for relation30/03 17:31
pumpkin(means a homogeneous binary relation over naturals, living in the zero universe)30/03 17:31
pumpkinbut yeah, you can think of ... -> Set as being a relation of some sort30/03 17:32
djahandarieZero universe?30/03 17:32
pumpkinSet30/03 17:32
pumpkinSet zero == Set30/03 17:32
joe6what is the use of defining these relations?30/03 17:32
Saizandata Foo : Rel N zero where ...; means that Foo is a datatype indexed by two naturals30/03 17:32
djahandarieOh, okay30/03 17:32
pumpkinjoe6: as I was saying yesterday, in weaker languages, you use Bool there30/03 17:32
pumpkinbut Bool carries no useful proof information30/03 17:32
pumpkinthe Set does30/03 17:33
pumpkinbut doesn't actually have a decision procedure for telling you whether a particular pair of numbers are30/03 17:33
pumpkinso you combine the proofy relation with a Dec type to get both30/03 17:33
pumpkinDec will say "these values _are_ related, and I have proof!" or "these values _are not_ related, and I have proof that they aren't!!!"30/03 17:34
pumpkinor more like "these values are not related, and if you think you have proof that they are, I can prove you're lying"30/03 17:34
xplatpumpkin: i pushed the triangle law, and in a separate commit, additions to .gitignore30/03 17:36
pumpkinxplat: awesome, thanks!30/03 17:36
pumpkincartesian is about 1/3 done, I'd guess :)30/03 17:36
joe6pumpkin, if you do not mind, can you please post a sample piece of code on its' usage. I understand what you are saying from a theoretical perspective, but am not able to convert it to a practical usage (in my mind, I mean)..30/03 17:37
xplatpumpkin: the good news on memory is i have a single stick, so i just need 1 more.  bad side is most of the places that are SUPPOSED to have memory in stock want me to pay more for 1 than i'd pay online for 2, *and* wait for them to be shipped to the store :(30/03 17:38
joe6pumpkin, this has more to do with my lack of knowledge of proofs, but, am hoping that a sample piece of code will help my understanding.30/03 17:38
xplatbest i found was Kingston in stock with slightly over 50% markup30/03 17:38
xplatso i'm going to order online and i won't be able to do much beyond triangle until it comes in30/03 17:39
xplatas it was i had to restart emacs nearly with every change to get triangle done30/03 17:39
pumpkinxplat: that's fine, no rush30/03 17:40
pumpkinI really appreciate that you're working on this at all, given the state of the code :)30/03 17:40
pumpkinjoe6: sorry, I'll write something up later, at work now and only check IRC every so often30/03 17:44
pumpkindoes an abstract "type synonym" in agda behave like a newtype?30/03 17:50
joe6pumpkin, thanks a lot. Sorry for the bother.30/03 17:51
pumpkinnot at all30/03 17:51
pumpkinyou can write something like max : Nat -> Nat -> Nat using _<=?_30/03 17:52
pumpkinmax x y with x <=? y30/03 17:52
pumpkin... | yes _ = y30/03 17:52
joe6pumpkin, I think you can look through the "type synonym" in agda, as in haskell...30/03 17:52
pumpkin... | no _ = x30/03 17:52
joe6pumpkin, unlike the newtype in haskell.30/03 17:52
pumpkinjoe6: even if it's marked abstract?30/03 17:52
joe6pumpkin, sorry, no idea about that.30/03 17:53
pumpkinthe whole point of abstract is to not be able to look inside things, I thought30/03 17:53
joe6pumpkin, oh, ok. thanks.30/03 17:53
pumpkinyeah, so yes and no are constructors of Dec30/03 17:53
pumpkinthe ignored fields are the proofs30/03 17:53
pumpkinthat I don't need here30/03 17:53
xplatthat's just using Dec like a bool, though.  you can ALSO create a max that produces a proof that its result is at least as high as each argument :)30/03 17:54
pumpkinof course, and that's generally more interesting30/03 17:54
pumpkinbut joe6 doesn't seem like he wants to do proofy things just yet30/03 17:54
pumpkinjoe6: I would however encourage you to get started on that stuff as soon as possible, as it will blow your mind30/03 17:54
pumpkinand then you'll never want to go back to a language without dependent types30/03 17:54
joe6or, better yet, I do not have the knowledge to do proofy things yet, but, am willing to learn.30/03 17:54
pumpkinexcept for haskell30/03 17:54
pumpkinxplat: or you could just prove something about max, separately30/03 17:55
pumpkinI generally prefer that to returning sigmas30/03 17:55
pumpkinalthough the proof will often duplicate the structure of the function being called30/03 17:55
joe6pumpkin, thanks, that is my goal. I am finding the agda tutorials on the agda website tough going. I probably need to understand how software proofs work and then read through the agda website to get the details on how they are done in agda.30/03 17:56
xplatpumpkin: that too.  although you return sigmas when you make records!30/03 17:56
pumpkinyeah, but I accept it for CT :)30/03 17:56
pumpkinjoe6: even the PDF I linked to yesterday? that's a nice one, I think30/03 17:56
joe6pumpkin, i read through it. but, i need something more fundamental that. in the sense " what is software proof?' "How does it help?", those kind of questions..30/03 17:57
pumpkinhttp://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspondence and http://en.wikibooks.org/wiki/Haskell/The_Curry-Howard_isomorphism are probably very helpful here30/03 17:58
pumpkinindependent of any programming language30/03 17:59
joe6pumpkin, ok, thanks. will check them out.30/03 18:00
jmcarthurpumpkin: just curious, as this is something i'm still getting used to... for what reason to you prefer separate proofs over returning sigmas?30/03 18:06
jmcarthurs/to you/do you/30/03 18:06
pumpkinit lets me separate behavior from spec more nicely, but is a bit more work30/03 18:07
pumpkinthat doesn't mean I don't like to use indexed families to make the proofs as simple as possible when I get around to them30/03 18:07
jmcarthurso you don't mind using a Vec when a List would do, but you do mind constructing a proof object in the midst of a computation that you don't actually need for the computation30/03 18:08
pumpkinyeah30/03 18:09
pumpkinnot sure that's a "good" thing30/03 18:09
jmcarthurwhat if you need a proof object to use Vec when you wouldn't need it to use List?30/03 18:09
pumpkinbut it's just what I've come to prefer after tinkering for a while30/03 18:09
pumpkinthen I'll do what it takes to appease the Vec30/03 18:09
jmcarthurmmkay30/03 18:09
pumpkinideally in as clean a way as possible30/03 18:09
pumpkinusing rewrites on the left or something30/03 18:09
jmcarthurthis helps me because i haven't decided on a policy for this stuff at all yet and now i at least have something to follow until i make my own opinions30/03 18:10
jmcarthurwhat annoys me is that there are tradeoffs at all :\30/03 18:10
pumpkinI think CPDT suggests something similar, iirc30/03 18:10
pumpkinfirst of all, you don't necessarily know everything you want to prove about a function before writing it30/03 18:11
jmcarthuri think my personal (ignorant) preference would be for the function's type to be a complete specification, or else the function is so trivial that its implementation is the specification. i intend this to be distinct from premptively proving arbitrary properties about the function, though30/03 18:13
jmcarthuri don't think things necessarily would get too hairy from that, but what do i know30/03 18:14
pumpkinwell, it just means you'd have things like30/03 18:14
pumpkinf : (x : A) -> (y : B) -> Sigma C (\z -> (proof1 x y z) x (proof2 x y z) x (proof3 x y z) x (proof4 x y z))30/03 18:15
jmcarthurwell30/03 18:15
pumpkinbrb food30/03 18:16
jmcarthurthere's really two dimensions here. one is whether to includ