Re: ghc search paths (like CPATH for gcc)

2009-10-28 Thread Misha Aizatulin
Simon Marlow wrote: On 19/10/2009 05:17, Misha Aizatulin wrote: Hello, is there a mechanism for ghc similar to setting the CPATH variable for gcc? I'd like ghc to look in the given list of paths every time it compiles something, without me having to retype the flags. For ghci

ghc search paths (like CPATH for gcc)

2009-10-18 Thread Misha Aizatulin
Hello, is there a mechanism for ghc similar to setting the CPATH variable for gcc? I'd like ghc to look in the given list of paths every time it compiles something, without me having to retype the flags. For ghci there is .ghci, but it gets ignored when I run ghc. Best, Misha

Re: [Haskell-cafe] Alternatives to convoluted record syntax

2008-07-04 Thread Misha Aizatulin
Hi, busNum n | (isBusId n) = $(modify 'query) ($(set 'queryBusNumber) (Just n)) | otherwise = id The solution I am using is creating for each record type @Rec@, and each of its fields @fieldName :: T@ an updater updateFieldName :: (T - T) - Rec - Rec This way you can

Re: [Haskell-cafe] ANN: Haddock Trac

2008-06-16 Thread Misha Aizatulin
hi, I wasn't able to add an attachment to a ticket, is something wrong with permissions? Python Traceback Traceback (most recent call last): File /var/lib/python-support/python2.4/trac/web/main.py, line 387, in dispatch_request dispatcher.dispatch(req) File

[Haskell-cafe] Calling haddock in a portable way

2008-05-17 Thread Misha Aizatulin
hello, the new version of haddock (2.0.0) needs a new option -B that tells it the GHC lib directory. How do I find out the correct value for this option in a makefile, so that the makefile stays portable? Cheers, Misha ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Calling haddock in a portable way

2008-05-17 Thread Misha Aizatulin
Maybe you could do something like call out to a shell and ask it to run 'ghc --print-libdir'? That for me prints to stdout a string like '/usr/lib64/ghc-6.8.2'. Yes, this looks like a solution. Thanks a lot! ___ Haskell-Cafe mailing list

[Haskell-cafe] restricted existential datatypes

2007-01-09 Thread Misha Aizatulin
to me - leading to the problem above. I would be very thankful for any suggestions! Cheers, Misha Aizatulin 1. John Hughes, Restricted Data Types in Haskell, September 4, 1999 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Dumping context reduction steps

2007-01-02 Thread Misha Aizatulin
hi, is there some command line switch in GHC that would allow me to see context reduction steps during the compilation? Thanks, Misha ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org

Re: [Haskell-cafe] The Read Class

2006-10-28 Thread Misha Aizatulin
Tiago Veloso wrote: I am trying to find out how to work with the Read Class for a school project, i need to declare instances of Read for a few data types. My problem is that i do not know how to do it, i mean i do not know how to build a Read instance, i do know about it for the Show Class.

[Haskell-cafe] Guards with do notation?

2006-10-23 Thread Misha Aizatulin
hello all, why is it not possible to use guards in do-expressions like do (a, b) | a == b - getPair return a and b are equal Cheers, Misha ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] [off-topic / administrative] List Reply-to

2006-10-10 Thread Misha Aizatulin
Matthias Fischmann wrote: Some lists have the Reply-To: set to the list address. I think you can even configure the From: to be haskell-cafe instead of the poster, making the poster merely identifiable by the Sender: field. Do you have strong opinions on this subject? Here is an

Re: [Haskell-cafe] casting

2006-10-09 Thread Misha Aizatulin
Thomas Conway wrote: I'm having some difficulty with typeclasses. What I'm trying to do should be obvious, but it's still giving me trouble. I want to take a packaged item, and strengthen the constraints on its type. Rather than being just any type that is an instance of A, I want to do a

Re: [Haskell] Deferred instance declarations (serialization of existential boxes)

2006-09-27 Thread Misha Aizatulin
Simon Peyton-Jones wrote: Concerning your application | I am having a box like | data Box = forall a. Cxt a = Box a | and want to write a Read instances for it. I don’t see how it helps to defer the Read instance. I would defer the instance declaration till the point where I know

Re: [Haskell-cafe] Re: Haskell web forum

2006-09-21 Thread Misha Aizatulin
Kurt Hutchinson wrote: Let those interested in a web forum set one up and run it. Those interested in email can ignore the web forum. My concern about introducing a web forum would be that it is yet another place I have to search every time I need information (besides the haskell report,

[Haskell] Deferred instance declarations (serialization of existential boxes)

2006-09-20 Thread Misha Aizatulin
hello all, I asked this question on haskell-cafe once, but my post didn't get any responses, so I try once again here explaining a bit more where my problem comes from. Suppose I have a monomorphic datatype, say T and want to do something with it, which depends on an instance of class C

Re: [Haskell-cafe] sections for record settors

2006-09-19 Thread Misha Aizatulin
It would be nice if there was some sort of section-like syntax to access the settor function Indeed - I'd like it as well. Also these threads seem to deal with similar questions: http://www.haskell.org/pipermail/haskell/2005-February/015354.html

[Haskell-cafe] Deferred instance declarations (context without type variables)

2006-09-16 Thread Misha Aizatulin
hello, I have a question about context in type signature. I would like to write a function, say (f :: T - T) which also relies on an instance of class C being defined for T. The problem is, I don't want this instance defined at the same time f is defined, instead I would like to defer this

Re: [Haskell-cafe] Serialising types with existential data constructors

2006-09-16 Thread Misha Aizatulin
Klaus Ostermann and I allude to this non-trivial extensibility problem in our GPCE 2006 paper and we started to look into ways (not in that paper) to resolve the problem in a principled way. I'm really looking forward to that! For now I'll probably use Template Haskell to register all

RE: Re: [Haskell-cafe] Serialising types with existential data constructors

2006-09-13 Thread Misha Aizatulin
Einar Karttunen wrote: I've been using existentially quantified data constructors like data Box = forall a. Cxt a = Box a If you can include Typeable into the mix then serializing works. Serialize the value as name of type value. When deserializing use a Map name of type

[Haskell-cafe] Serialising types with existential data constructors

2006-09-12 Thread Misha Aizatulin
hello all, I've been using existentially quantified data constructors like data Box = forall a. Cxt a = Box a quite successfully for a while. But now I am trying to implement the Load/Save mechanism and getting stuck with that. It's not hard to write a Box into a file, but how do I get it

Re: [Haskell-cafe] Serialising types with existential data constructors

2006-09-12 Thread Misha Aizatulin
Bulat Ziganshin wrote: data Box = forall a. Cxt a = Box a quite successfully for a while. But now I am trying to implement the Load/Save mechanism and getting stuck with that. It's not hard to write a Box into a file, but how do I get it back? gshow/gread provided by module

Re: [Haskell-cafe] Derived Read instance for types with infix constructors (ghc 6.4.1)

2006-09-09 Thread Misha Aizatulin
Daniel Fischer wrote: Another thing: Would it be a good idea to create derived Read instances that could parse both, A `And` A and And A A ? Since 6.4.2 parses the former and 6.2.2 parses the latter that should be possible, I believe (and both forms are accepted at the ghci prompt). I

[Haskell-cafe] Re: Derived Read instance for types with infix constructors (ghc 6.4.1)

2006-08-26 Thread Misha Aizatulin
Neil Mitchell wrote: *Main show $ A `And` A A And A For me, using GHCi 6.4.2 + Windows, I get: A `And` A I installed GHC 6.4.2 now (on Linux). It really does print A `And` A, but still doesn't read it. Would you agree that GHC doesn't conform to the Haskell Report here? In fact it seems

Re: [Haskell-cafe] Re: Derived Read instance for types with infix constructors (ghc 6.4.1)

2006-08-26 Thread Misha Aizatulin
Jason Dagit wrote: Before you get too caught up in deriving Read, remember that in Haskell it's very easy to create your own custom parser. Assuming you have previous experience with happy or parsec you could probably have already created a custom parser with time you've spent debugging this

Re: [Haskell-cafe] Re: Derived Read instance for types with infix constructors (ghc 6.4.1)

2006-08-26 Thread Misha Aizatulin
Ian Lynagh wrote: ghci on 6.4.2 Linux works for me: oops, works for me too - I forgot the type annotation when calling read :) So it's fine in 6.4.2 - sorry for the disturbance then! Cheers, Misha ___ Haskell-Cafe mailing list