Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-01-26 Thread AntC
Steve Horne sh006d3592 at blueyonder.co.uk writes: There's a proposal at the moment to add support for TDNR to Haskell - to leverage the power of the dot (e.g. for intellisense).http://hackage.haskell.org/trac/haskell- prime/wiki/TypeDirectedNameResolution I approve of the goal,

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-01-31 Thread AntC
the joys of pointless style. AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-01-31 Thread AntC
Donn Cave donn at avvanta.com writes: Quoth AntC anthony_clayden at clear.net.nz, ... My proposal is that field selection functions be just ordinary functions, and dot notation be just function application(tight-binding). Then: object.fieldfuncmethod == fieldfuncmethod object

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-01 Thread AntC
Kevin Quick quick at sparq.org writes: On Tue, 31 Jan 2012 23:10:34 -0700, Anthony Clayden anthony_clayden at clear.net.nz wrote: I'm proposing x.f is _exactly_ f x. That is, the x.f gets desugared at an early phase in compilation. Anthony, I think part of the concern people are

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-01 Thread AntC
they are.] AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-03 Thread AntC
Kevin Quick quick at sparq.org writes: Currently under H98: f.g-- (both lower case, no space around the dot) Is taken as function composition -- same as (f . g). f. g -- is taken as func composition (f . g) f .g -- is taken as func composition (f . g)

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-03 Thread AntC
Gábor Lehel illissius at gmail.com writes: On Fri, Feb 3, 2012 at 10:30 AM, AntC anthony_clayden at clear.net.nz wrote: You seem to be not alone in wanting some special syntax for applying field selectors (see other posts on this thread). H98 field selectors don't do this, they're just

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-03 Thread AntC
Gábor Lehel illissius at gmail.com writes: On Fri, Feb 3, 2012 at 2:37 PM, AntC anthony_clayden at clear.net.nz wrote: Do people really write code with huge pile-ups of functions prefix upon prefix? Wouldn't that be confusing even when it's unidirectional? Not really. Pipeline-like

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-06 Thread AntC
Donn Cave donn at avvanta.com writes: Quoth AntC anthony_clayden at clear.net.nz, ... We're on the slippery slope! Where will it end? And now that I've found it, I so love: customer.lastName.tail.head.toUpper-- Yay! ... compared to present practice, with where dot

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-06 Thread AntC
for function composition. There's certainly nothing about a dot that suggests function composition, *unless* ... AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-06 Thread AntC
). Then all I need is a type-(or kind-) level 'peg' for the name, and an instance for Has/get/set. AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution - record update

2012-02-09 Thread AntC
agree workable constraints, we're going to just run into further difficulties (like type inference becoming unmanageable without lots of type annotations to help resolve instances). AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution -record update

2012-02-09 Thread AntC
AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-19 Thread AntC
Overloaded Record Fields. Thanks to the voiciferousness on this thread, dot notation is completely optional. Feedback welcome. AntC -- View this message in context: http://haskell.1045720.n5.nabble.com/Some-thoughts-on-Type-Directed-Name-Resolution-tp5280846p5498073.html Sent from the Haskell

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-20 Thread AntC
Gábor Lehel illissius at gmail.com writes: On Mon, Feb 20, 2012 at 4:41 AM, AntC anthony_clayden at clear.net.nz wrote: Folks, I've put my 'Record in Haskell' proposal on the wiki http://hackage.haskell.org/trac/ghc/wiki/Records  as suggestion 5 Declared Overloaded Record Fields

Re: [Haskell-cafe] Records in Haskell

2012-03-01 Thread AntC
polymorphic firstName and lastName. [By the way, did you mean to post to the cafe only? Most of the discussion is going on on ghc-users.] AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] What's the term for this? Alpha-reordering? [was: Re: FreeSect -- generalised sections syntax extension

2012-03-03 Thread AntC
in Haskell'. There's a proposal using a typeclass with type arguments in a different order to the other proposals.] AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] [Haskell] Higher types in contexts

2012-03-05 Thread AntC
get the function into the record without using an explicit data constructor. What am I doing wrong? AntC -- View this message in context: http://haskell.1045720.n5.nabble.com/Re-Haskell-Higher-types-in-contexts-tp5537428p5539147.html Sent from the Haskell - Haskell-Cafe mailing list archive

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-24 Thread AntC
would be fine.  (I may live to eat my words here.)  AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-24 Thread AntC
Twan van Laarhoven twanvl at gmail.com writes: On 24/05/12 14:14, AntC wrote: Simon Peyton-Jonessimonpjat microsoft.com writes: Have you considered the alternative notation where multiple guards are allowed, as in normal function definitions? Something like: type instance F

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-26 Thread AntC
Gábor Lehel illissius at gmail.com writes: On Fri, May 25, 2012 at 7:06 AM, AntC anthony_clayden at clear.net.nz wrote: But it looks like the work SPJ pointed to is using closed style. ... If you're referring to the NewAxioms work Simon linked to in the other thread, I don't see

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-28 Thread AntC
Transformer example: [3] by MPJ uses overlaps for MonadT. And MonadT was (I thought) what gave all the trouble with overlaps and default instances and silently changing behaviour. (There's a brief example in Morris' supporting survey - ref [11] in [2].) Anybody out there can explain further? AntC

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-05-31 Thread AntC
). It's all so *dys-functional* (IMO). My take is that we should abandon Fundeps, and concentrate on introducing overlaps into type functions in a controlled way (what I've called 'dis- overlapped overlaps'.) AntC ___ Haskell-Cafe mailing list Haskell

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-06-04 Thread AntC
, to provide a different style of defining type functions, as well as dis-overlapping overlaps. AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Using promoted lists

2012-06-07 Thread AntC
to the element you want. AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] CRIP: the Curiously Reoccuring Instance Pattern

2012-07-31 Thread AntC
(using TypeCast -- but looks prettier in GHC with equality constraints). Essentially it's a FunDep-like mechanism without FunDeps (as SPJ calls it), to achieve what Ryan's talking about. But you are quite right that we still need overlapping instances for parts of the type-level logic. AntC

Re: [Haskell-cafe] CRIP: the Curiously Reoccuring Instance Pattern

2012-08-02 Thread AntC
'. (That is, a typevar distinct from any others in the head.) 6. (As you said to Ryan) we still sometimes need repeated typevars in the head, for instances that are (in effect) testing for equality. But these should only be in the 'argument' position. AntC [1] http://hackage.haskell.org/trac/ghc/wiki/Records

Re: [Haskell-cafe] CRIP: the Curiously Reoccuring Instance Pattern

2012-08-03 Thread AntC
-in-progress NewAxioms is aiming for something similar, but only for type functions. Perhaps in the longer term we use that to build helper functions, then banish overlapping type classes? (I still think that explicitly dis-overlapped instances would be easier to understand.) AntC

Re: [Haskell-cafe] CRIP: the Curiously Reoccuring Instance Pattern

2012-08-06 Thread AntC
in murky water'. So I can't see a need for TTypeable even back in 2004. AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Fixity declaration extension

2012-08-13 Thread AntC
be better. (Anything else we can bikeshed about while we're at it?) AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Destructive updates to plain ADTs

2012-09-09 Thread AntC
an imperative/object-oriented language? If you're trying to create a static data structure, perhaps the credit card transform is the approach to use? ... I would like just to run some benchmarks and see the results. Running benchmarks for destructive updates in Haskell seems a waste of time(?) AntC

Re: [Haskell-cafe] A yet another question about subtyping and heterogeneous collections

2012-10-18 Thread AntC
way to handle this is using type functions (aka type families aka associated types), but I'm not sure how that would apply here. (And, for the record, the old-fashioned way would use functional dependencies, as per the Heterogenous Collections paper aka 'HList's). AntC

Re: [Haskell-cafe] A yet another question about subtyping and heterogeneous collections

2012-10-22 Thread AntC
Dmitry Vyal akamaus at gmail.com writes: On 10/19/2012 06:14 AM, AntC wrote: Roman Cheplyaka roma at ro-che.info writes: [snip] instance (Upcast a b, Upcast b c) = Upcast a c where upcast = (upcast :: b - a) . (upcast :: c - b) This is the offending instance. Remember, GHC only

Re: [Haskell-cafe] Sparse records/ADTs

2012-10-24 Thread AntC
, it could be a helpful discipline to design data structures without needing Maybe's. AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Diving into the records swamp (possible GSoC project)

2013-04-26 Thread AntC
/TPDORF proposals are aimed much better as a step towards first- class record types. [IMO **] Oleg/Ralf's HList paper covers all the ground for first-class records. It depends heavily on overlaps, which is why the NewAxioms stuff would work in really well. AntC [2] http://hackage.haskell.org/trac

Re: [Haskell-cafe] Diving into the records swamp (possible GSoC project)

2013-04-27 Thread AntC
'databases' mean academics don't get taught normalisation any more(?) AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Diving into the records swamp (possible GSoC project)

2013-04-27 Thread AntC
the Haskell record system 'as is' so dysfunctional that they give up on it! I feel strongly that as soon as we get past the name collissions, there'll be other blockages to using it. I'd be interested to hear if there are any who can remember the Trex system, and how (un)usable it was? AntC

Re: [Haskell-cafe] HList records access time [was: Diving into the records swamp]

2013-04-28 Thread AntC
Haskell would help with generating the instances for all of the n-tuples -- otherwise it's a lot of boilerplate. The tricky part comes with TIple-level combinations such as extend or append. That might be where NewAxioms overlaps come in to calculate the type of the result. AntC

Re: [Haskell-cafe] GADTs and pattern matching

2013-06-19 Thread AntC
Francesco Mazzoli f at mazzo.li writes: I have stumbled upon a strange annoyance: {-# LANGUAGE GADTs #-} Hi Francesco, I think you'll find that the 'annoyance' is nothing to do with GADTs. I suggest you take the type signature off of foo1, and see what type ghc infers for it. It

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-11 Thread AntC
-identical lines of code sounds like an opportunity for an algorithm. AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Why are field selectors functions? [was: ghc-users A possible alternative to dot notation for record access]

2013-07-18 Thread AntC
is there this `foo` thing that isn't an Int? AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] One-element tuple

2013-08-15 Thread AntC
a = [a] [CustId 47] -- at least looks bracket-y What do you do? AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] One-element tuple

2013-08-19 Thread AntC
Brent Yorgey byorgey at seas.upenn.edu writes: data Oneple a = Oneple a -- (or newtype) (Oneple $ CustId 47) -- too verbose This is what the OneTuple package is for: Thank you Brent, and Ivan made the same suggestion. Apart from

Re: [Haskell-cafe] ordNub

2013-08-19 Thread AntC
Richard A. O'Keefe ok at cs.otago.ac.nz writes: There are at least four different things that an Ord version might mean: - first sort a list, then eliminate duplicates - sort a list eliminating duplicates stably as you go (think 'merge sort', using 'union' instead of 'merge') -

Re: [Haskell-cafe] One-element tuple

2013-08-19 Thread AntC
Lattice' [6]). Is there anybody using OneTuple 'in anger'? AntC [1] M. Shields and E.Meijer. Type-indexed rows. In Proceedings of the 28th ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages, pages 261–275. ACMPress, 2001. [2] http://hackage.haskell.org/package/HList [3] http

Re: [Haskell-cafe] One-element tuple

2013-08-19 Thread AntC
infrastructure. Thanks Ivan for the dependencies list. No surprise that Hlist is using OneTuple == HCons a HNil. That need is exactly what I'm talking about, not a joke. Lennart's `tuple` package likewise (but no use to me because it's using positional access, not Type-Indexed). AntC So if I have

Re: [Haskell-cafe] One-element tuple

2013-08-20 Thread AntC
that would require working with the messier Annotated syntax tree. wow! Adam, thank you. Even copes with multiple nested parens nested parens instance C ((a, b)) c ... == instance C ((a, b)) (OneT.OneTuple (OneT.OneTuple c)) ... AntC

Re: [Haskell-cafe] Retrieving Haddock comments with haskell-src-exts

2013-08-21 Thread AntC
each comment where the comment's Span falls between the nodes' Loc? Would this need too much lookahead? (And thank you to Adam for introducing me to the joys of source-munging. http://www.haskell.org/pipermail/haskell-cafe/2013-August/108426.html .) AntC

[Haskell-cafe] type constructor section for (- Bool), _not_ ((-) Bool)

2013-09-03 Thread AntC
I'm probably being dumb, but Hoogle nor the wiki are helping me. I want an instance and type improvement constraint of the form instance (f ~ (- Bool)) = C Foo (f b) where ... The first arg to C is driving type improvement, for example: instance (f ~ []) = C Bar (f b) where ... (The

Re: [Haskell-cafe] type constructor section for (- Bool), _not_ ((-) Bool)

2013-09-04 Thread AntC
Brent Yorgey byorgey at seas.upenn.edu writes: On Tue, Sep 03, 2013 at 11:33:46AM +, AntC wrote: I want an instance and type improvement constraint of the form instance (f ~ (- Bool)) = C Foo (f b) where ... There is no operator section syntax for types. Moreover

Re: [Haskell-cafe] Using lenses

2013-10-03 Thread AntC
lenses.) AntC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] ordNub

2013-10-13 Thread AntC
Niklas Hambüchen mail at nh2.me writes: In sets, the order does not matter, while for nub it does. Let's be careful here!. Niklas, when you say order, do you mean: * the _ordering_ from the Ord instance? Or * the relative sequence of elements in the list? ... the fact that Set is used

Re: [Haskell-cafe] ordNub

2013-10-13 Thread AntC
Niklas Hambüchen mail at nh2.me writes: On 13/10/13 21:42, AntC wrote: ... If you use the Set library, that fact may be very visible! Because Set re-sequences the whole list, as per its Ord instance. But List.nub preserves the list sequence (except for omitting duplicates). I

Re: [Haskell-cafe] ordNub

2013-10-13 Thread AntC
Niklas Hambüchen mail at nh2.me writes: On 14/10/13 03:20, AntC wrote: ... Then here's a further possible optimisation, instead of making separate calls to `member` and `insert`: This I understand again. Where do you get insert' from? containers doesn't seem to have it. Do you