Re: Advice on type families and non-injectivity?

2013-01-13 Thread Richard Eisenberg
Hi Conal, I agree that your initial example is a little puzzling, and I'm glad that the new ambiguity checker prevents both definitions, not just one. However, your initial question seems broader than just this example. I have run into this problem (wanting injective type functions) several tim

Re: Advice on type families and non-injectivity?

2013-01-13 Thread Christian Höner zu Siederdissen
Hi Conal, if you take your example program and write "foo :: Bool", ghci accepts it? For me it complains, and I would think rightly so, that "couldn't match expected type Fa with actual type Bool". It actually only works with the following quite useless "type instance F a = Bool". By the way, us

Re: Bytestring and GHC 7.6.2

2013-01-13 Thread Duncan Coutts
On 12 January 2013 16:05, Ian Lynagh wrote: > On Tue, Jan 08, 2013 at 08:10:18PM +, Duncan Coutts wrote: >> >> Either way, lemme know if this is all fine, and I'll make the 0.10.0.2 >> release. > > Looks good, thanks! I've updated the GHC 7.6 repo to match the tag. Ta muchly! ___

Re: Advice on type families and non-injectivity?

2013-01-13 Thread Iavor Diatchki
Hello, On Sun, Jan 13, 2013 at 12:05 PM, Conal Elliott wrote: > > > so there is really no way for GHC to figure out what is the intended value >> for `a`. >> > > Indeed. Though I wonder: does the type-checker really need to find a > binding for `a` in this case, i.e., given the equation `(forall

Re: Advice on type families and non-injectivity?

2013-01-13 Thread Conal Elliott
Hi Christian, Given "bar :: Bool", I can't see how one could go from "Bool" to "F a = > Bool" and determine "a" uniquely. > The same question applies to "foo :: Bool", right? Yet no error message there. Regards, - Conal On Sun, Jan 13, 2013 at 11:36 AM, Christian Höner zu Siederdissen < choe...

Re: Advice on type families and non-injectivity?

2013-01-13 Thread Conal Elliott
Hi Iavor, Thanks for the remarks. so there is really no way for GHC to figure out what is the intended value > for `a`. > Indeed. Though I wonder: does the type-checker really need to find a binding for `a` in this case, i.e., given the equation `(forall a. F a) == (forall a'. F a')`? -- Conal

Re: Advice on type families and non-injectivity?

2013-01-13 Thread Iavor Diatchki
Hello Conal, The issue with your example is that it is ambiguous, so GHC can't figure out how to instantiate the use of `foo`. It might be easier to see why this is if you write it in this form: > foo :: (F a ~ b) => b > foo = ... Now, we can see that only `b` appears on the RHS of the `=>`, s

Re: Advice on type families and non-injectivity?

2013-01-13 Thread Christian Höner zu Siederdissen
Hi, How would you infer "a" from "F a"? Given "bar :: Bool", I can't see how one could go from "Bool" to "F a = Bool" and determine "a" uniquely. My question is not completely retorical, if there is an answer I would like to know it :-) Gruss, Christian * Conal Elliott [13.01.2013 20:13]: >

Advice on type families and non-injectivity?

2013-01-13 Thread Conal Elliott
I sometimes run into trouble with lack of injectivity for type families. I'm trying to understand what's at the heart of these difficulties and whether I can avoid them. Also, whether some of the obstacles could be overcome with simple improvements to GHC. Here's a simple example: > {-# LANGUAGE

Re: Building ghc on raspberry pi.

2013-01-13 Thread Neil Davies
Understood I've got another RPi supposed to arrive this week - would more computation power help anyone out there? Neil On 13 Jan 2013, at 15:59, rocon...@theorem.ca wrote: > On Sun, 13 Jan 2013, Neil Davies wrote: > >> Sounds like we're close - I must admit I've slightly lost track of the >

Re: Building ghc on raspberry pi.

2013-01-13 Thread roconnor
On Sun, 13 Jan 2013, Neil Davies wrote: Sounds like we're close - I must admit I've slightly lost track of the things that need to be done. Can we start collecting the pre-conditionds and steps, when each complete build takes best part of a day, its difficult to keep the context. So - taking

Re: Understand disassemble for segfault on android

2013-01-13 Thread Nathan Hüsken
Ok, the instruction ldr r1, [r0, #140] <-> tso = CurrentTSO seems the assume that REG_Base is r0 (140 is the offset of the tso in StgRegTable, to which the REG_Base register should point). But according to MachRegs.h on arm architecture, REG_Base should be r4. Ineed, when I do p *(unsigned

Re: Building on android - compiled program segfaults

2013-01-13 Thread Nathan Hüsken
Mmh, that does not seem to work. (gdb) strace warning: Couldn't determine the static tracepoint marker to probe Static tracepoint 1 at 0x3f0588 On 01/13/2013 12:56 PM, Conrad Parker wrote: > On 11 January 2013 19:36, Nathan Hüsken wrote: >> Hi, >> >> I was succesfull in building ghc (pulled from

Re: Building on android - compiled program segfaults

2013-01-13 Thread Nathan Hüsken
There is some more success :). When I do an unregisterised build, it works without segfault. On 01/13/2013 11:16 AM, Bernhard Urban wrote: > Hi Nathan, > > On Fri, Jan 11, 2013 at 12:36 PM, Nathan Hüsken > wrote: >> I was succesfull in building ghc (pulled from git) to compile for >> arm-linux-a

Re: Building on android - compiled program segfaults

2013-01-13 Thread Conrad Parker
On 11 January 2013 19:36, Nathan Hüsken wrote: > Hi, > > I was succesfull in building ghc (pulled from git) to compile for > arm-linux-androideabi! > > Now using "inplace/bin/ghc-stage1 -dcore-lint -debug" I compiler this > Main.hs: > > main = putStrLn "Hello, World" > > I get an executable, which

Re: Building ghc on raspberry pi.

2013-01-13 Thread Neil Davies
Sounds like we're close - I must admit I've slightly lost track of the things that need to be done. Can we start collecting the pre-conditionds and steps, when each complete build takes best part of a day, its difficult to keep the context. So - taking the ghc 7.4.1 that is part of raspian whee

Re: Building on android - compiled program segfaults

2013-01-13 Thread Bernhard Urban
Hi Nathan, On Fri, Jan 11, 2013 at 12:36 PM, Nathan Hüsken wrote: > I was succesfull in building ghc (pulled from git) to compile for > arm-linux-androideabi! Great news! Can you describe how you managed to build it and which environment you use? > main = putStrLn "Hello, World" > > I get an e