`StablePtr` in `ST`

2019-08-20 Thread Matthew Farkas-Dyck
I have been doing some work where i want `StablePtr`, but also to not be confined to `IO`. I saw the following comment in "compiler/prelude/PrimOp.hs": Question: Why @RealWorld@ - won't any instance of @_ST@ do the job? [ADR] It has been there for 20 years. What is the answer? If it is safe i'll

Re: Exposing target language in Haskell with GHC API

2016-09-02 Thread Matthew Farkas-Dyck via Glasgow-haskell-users
Hi, thanks for the response. On 26/08/2016, Christiaan Baaij wrote: > You mentioned that GHC does name mangling, but I must say I've never > seen GHC do this. I guess this was unclear: our compiler is mangling the names from GHC core, lest any clash with a BlueSpec keyword. We need to find a way

Exposing target language in Haskell with GHC API

2016-08-23 Thread Matthew Farkas-Dyck via Glasgow-haskell-users
A colleague and i are writing, as an unofficial side project, a Haskell→Bluespec compiler, using GHC as our Haskell front-end. The source language of the part we are writing is GHC Core. We need to somehow expose some Bluespec terms and types to the Haskell source program. We had a few ideas: 1. So

Records in Haskell: Explicit Classy Records

2012-04-11 Thread Matthew Farkas-Dyck
Hello GHC users. I made another proposal for records in Haskell, meant to solve just the namespace problem, and no more. http://hackage.haskell.org/trac/ghc/wiki/Records/ExplicitClassyRecords In this system, record selectors are overloaded in explicitly-user-declared type classes. Thus one can co

Re: Records in Haskell: Type-Indexed Records (another proposal)

2012-03-08 Thread Matthew Farkas-Dyck
On 06/03/2012, AntC wrote: > Matthew Farkas-Dyck gmail.com> writes: >> > Oh, and how do you deal with multiple record constructors as in H98: >> >data T a = T1 { x :: a, y :: Bool } >> > | T2 { x :: a } >> > >> Not sure what you m

Re: Records in Haskell: Type-Indexed Records (another proposal)

2012-03-05 Thread Matthew Farkas-Dyck
On 03/03/2012, AntC wrote: > Apart from the Quasifunctor bit, I think you'll find your proposal is a rather > cut-down version of DORF, just using different syntactic sugar. > (Oh, and with the arguments to Has in a different order, just to be > confusing.) Not so. I chose this order to make it

Records in Haskell: Type-Indexed Records (another proposal)

2012-03-03 Thread Matthew Farkas-Dyck
Hello all. I wrote a new proposal for the Haskell record system. It can be found at http://hackage.haskell.org/trac/ghc/wiki/Records/TypeIndexedRecords Records are indexed by arbitrary Haskell types. Scope is controlled as scope of key types. No fieldLabel declarations needed (as in DORF). Cheer

Re: Holes in GHC

2012-01-28 Thread Matthew Farkas-Dyck
On 26/01/2012, Thijs Alkemade wrote: > Let me try to describe the goal better. The intended users are people > new to Haskell or people working with existing code they are not > familiar with. When starting with Haskell, at least in my experience, > it happens lot that you have an idea about what

Re: Type operators in GHC

2012-01-19 Thread Matthew Farkas-Dyck
On 19/01/2012, Ian Lynagh wrote: > Do you mean that in > > f :: (x, X, (+), (:+)) > > only x would be a type variable and X, (+), (:+) would be type > constructors, but that in > > g :: forall y, Y, (*), (:*) . > (x, X, (+), (:+), y, Y, (*), (:*)) > > y, Y, (*), (:*) would be type

Re: Type operators in GHC

2012-01-19 Thread Matthew Farkas-Dyck
On 19/01/2012, Joachim Breitner wrote: > (I have no good idea, but here is at least one: A dot '.' as the first > character indicates a type variable; compared to a ':' this is a > non-capitalized character). So that all symbols that start in dot are variables, and all others are types/constructo

Re: Posting etiquette, was Re: Records in Haskell

2012-01-19 Thread Matthew Farkas-Dyck
On 19/01/2012, Malcolm Wallace wrote: > I find it completely unreasonable for a reply to a very long post to quote > the entire text, only to add a single line at the bottom (or worse, embedded > in the middle somewhere). In this case, there are 7 pages of quotation > before your one-sentence con

Re: Records in Haskell

2012-01-18 Thread Matthew Farkas-Dyck
On 18/01/2012, Simon Peyton-Jones wrote: > | > Has *is* a type class. It can be used and abused like any other. > | > Record members with the same key ought to have the same semantics; the > | > programmer must ensure this, not just call them all "x" or the like. > | > > | > Weak types these are n

Re: Records in Haskell

2012-01-18 Thread Matthew Farkas-Dyck
On 18/01/2012, Gábor Lehel wrote: > (I *am*, however, uncomfortable with using straight-up type level > strings, without consideration for any particular alternative. If > nothing else they should at least be opaque symbols which can be > passed around and used in the supported contexts but not ma

Re: Records in Haskell

2012-01-18 Thread Matthew Farkas-Dyck
On 18/01/2012, Greg Weber wrote: > On Fri, Jan 13, 2012 at 8:52 PM, Simon Peyton-Jones > wrote: > >> >> But, the Has constraints MUST exist, in full glory, in the constraint >> solver. The only question is whether you can *abstract* over them. >> Imagine having a Num class that you could not abst

Re: Records in Haskell

2012-01-15 Thread Matthew Farkas-Dyck
On 13/01/2012, Simon Peyton-Jones wrote: > Thanks to Greg for leading the records debate. I apologise that I > don't have enough bandwidth to make more than an occasional > contribution. Greg's new wiki page, and the discussion so far has > clarified my thinking, and this message tries to expres

Re: Records in Haskell

2012-01-15 Thread Matthew Farkas-Dyck
On 15/01/2012, Ian Lynagh wrote: > On Sun, Jan 15, 2012 at 01:38:20PM +0100, Greg Weber wrote: >> > >> > The blocking issues are described on >> > http://hackage.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields >> > >> > a) "Representation hiding" (look for that heading) > > How about >

Re: Composition operator [was: Re: Records in Haskell]

2012-01-13 Thread Matthew Farkas-Dyck
Actually, we don't need symbols at all, nor all these damned letters. The set of valid characters in an identifier can be of size 2: one each upper- and lower-case, e.g. [Pp]. For example, to define const function: p :: P (p (P pp p)); p pp _ = pp; where P is function type. If we drop all the s

Re: Composition operator [was: Re: Records in Haskell]

2012-01-13 Thread Matthew Farkas-Dyck
On 13/01/2012, Herbert Valerio Riedel wrote: > On Fri, 2012-01-13 at 15:16 +1100, Morten Brodersen wrote: >> Unfortunately most unix/windows/tools/source controls/editors out >> there are Ascii only. > > So after about 20 years the unicode standard has been around, the > quantification "most" stil

Re: Composition operator [was: Re: Records in Haskell]

2012-01-13 Thread Matthew Farkas-Dyck
On 12/01/2012, Morten Brodersen wrote: > Even if Unicode is not required, there is still a fallout. Let's look at > a simple scenario: > > Somebody uploads a nice useful Haskell module that include a number of > Unicode symbols. > > Unfortunately most unix/windows/tools/source controls/editors out

Re: Records in Haskell

2012-01-13 Thread Matthew Farkas-Dyck
On 13/01/2012, Simon Peyton-Jones wrote: > Thanks to Greg for leading the records debate. I apologise that I > don't have enough bandwidth to make more than an occasional > contribution. Greg's new wiki page, and the discussion so far has > clarified my thinking, and this message tries to expres

Re: Records in Haskell

2012-01-12 Thread Matthew Farkas-Dyck
7;t matter what the non-unicode symbol is, and re-using existing > symbols is certainly advantageous. > > > > On Thu, Jan 12, 2012 at 10:02 AM, Matthew Farkas-Dyck > wrote: > >> On 09/01/2012, Isaac Dupree wrote: >> > You mean this wiki page, right?: >> &g

Re: Records in Haskell

2012-01-12 Thread Matthew Farkas-Dyck
On 09/01/2012, Isaac Dupree wrote: > You mean this wiki page, right?: > http://hackage.haskell.org/trac/ghc/wiki/Records/NameSpacing > >> That is, there are no fundamental >> objections to the implementation of this records implementation. > > I think that might be overly optimistic... I think the

Re: Records in Haskell

2012-01-12 Thread Matthew Farkas-Dyck
On 09/01/2012, Greg Weber wrote: > Thank you for all your feedback! I updated the wiki page accordingly. > > Let us stop and take note of what this feedback is about: the most > convenient syntax for manipulating records, and much of this feedback > applies to any records proposal. That is, there

Re: Records in Haskell

2012-01-08 Thread Matthew Farkas-Dyck
On 08/01/2012, Gábor Lehel wrote: > 2012/1/8 Greg Weber : >> >> >> 2012/1/8 Gábor Lehel >>> >>> Thank you. I have a few questions/comments. >>> >>> >>> >>> "The module/record ambiguity is dealt with in Frege by preferring >>> modules and requiring a module prefix for the record if there is >>> am

Re: Records in Haskell

2012-01-02 Thread Matthew Farkas-Dyck
On 02/01/2012, Simon Peyton-Jones wrote: > It seems to me that there's only one essential missing language feature, > which is appropriately-kinded type-level strings (and, ideally, the ability > to reflect these strings back down to the value level). Given that, template > haskell, and the HList

Re: Records in Haskell

2011-12-31 Thread Matthew Farkas-Dyck
> It seems to me that there's only one essential missing language feature, > which is appropriately-kinded type-level strings Isn't this possible now with type → kind promotion? > Cheers, > Gershom Cheers, (and Happy New Year), MFD ___ Glasgow-haskell

Re: Records in Haskell

2011-12-30 Thread Matthew Farkas-Dyck
: > quux (y . (foo >.< bar).baz (f . g)) moo > It's not that easy to distinguish from > quux (y . (foo >.< bar) . baz (f . g)) moo Yeah, that's why I dislike dot as compose operator (^_~) > > Matthew Farkas-Dyck wrote >> >> Certainly not no conflic

Re: Records in Haskell

2011-12-30 Thread Matthew Farkas-Dyck
Certainly not no conflicts: lambda expressions. On 30/12/2011, Colin Adams wrote: > On 30 December 2011 15:55, Matthew Farkas-Dyck wrote: > >> On 30/12/2011, Andriy Polischuk wrote: >> > Yet another idea: >> > Consider using '\' as record access op

Re: Records in Haskell

2011-12-30 Thread Matthew Farkas-Dyck
On 30/12/2011, Andriy Polischuk wrote: > Yet another idea: > Consider using '\' as record access operator. No conflicts with anything at > all, and, > moreover, it really looks like hierarchical access. Reminds of filesystems > though. I hope this is a joke. >

Re: "GeneralizedNewtypeDeriving"

2011-12-27 Thread Matthew Farkas-Dyck
er). > > Chris > > From: glasgow-haskell-users-boun...@haskell.org > [mailto:glasgow-haskell-users-boun...@haskell.org] On Behalf Of David Fox > Sent: 27 December 2011 14:50 > To: Matthew Farkas-Dyck > Cc: GHC users > Subject: Re: "GeneralizedNewtypeDeriving" > > M

"GeneralizedNewtypeDeriving"

2011-12-26 Thread Matthew Farkas-Dyck
Just of curiosity, why is it spelt with a z? Is it spelt thus in Scottish English? I thought that "generalised" is written throughout Great Britain. Cheers, MFD ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.

Re: Records in Haskell

2011-12-21 Thread Matthew Farkas-Dyck
Fair enough. On 20/12/2011, Chris Smith wrote: > On Tue, Dec 20, 2011 at 5:57 PM, Matthew Farkas-Dyck > wrote: >> Another thought: >> Perhaps bang as record selection operator. It would avoid further >> corner cases of dot, and it's not unprecedented in Haskell

Re: Records in Haskell

2011-12-20 Thread Matthew Farkas-Dyck
Another thought: Perhaps bang as record selection operator. It would avoid further corner cases of dot, and it's not unprecedented in Haskell (e.g. Data.Map.!). If one wished to use dot, one could do this: import Prelude hiding ((.)); import Control.Category.Unicode((∘)); (.) = (!);

Re: Records in Haskell

2011-11-04 Thread Matthew Farkas-Dyck
us/um/people/simonpj/Haskell/records.html -- Matthew Farkas-Dyck ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: Records in Haskell

2011-11-04 Thread Matthew Farkas-Dyck
ll.org/trac/ghc/wiki/Records/OverloadedRecordFields > > Please do correct errors, suggest solutions, or explore variants. > > Simon > > ___ > Glasgow-haskell-users mailing list > Glasgow-hask

Re: Profile: zero total time

2011-07-09 Thread Matthew Farkas-Dyck
nly for the single-threaed runtime. > > http://hackage.haskell.org/trac/ghc/ticket/5282#comment:8 > > On Jul 7, 2011, at 2:45 PM, Matthew Farkas-Dyck wrote: > >> Sorry, I ought to have mentioned: >> >> $ uname -sr >> Linux 2.6.38 >> >> On 7 July 2011

Re: Profile: zero total time

2011-07-07 Thread Matthew Farkas-Dyck
Sorry, I ought to have mentioned: $ uname -sr Linux 2.6.38 On 7 July 2011 14:03, Daniel Fischer wrote: > On Thursday 07 July 2011, 20:44:57, Matthew Farkas-Dyck wrote: >> I am trying to take a profile of a program, but when I run it, the >> total time (as given in the profiling

Profile: zero total time

2011-07-07 Thread Matthew Farkas-Dyck
7.0.3 and run with RTS options "-p -s". The true time taken is certainly NOT zero. How is this possible? Thanks. Cheers, Matthew Farkas-Dyck ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mail