Re: [Haskell] Hierarchical module namespace extension not sufficiently flexible

2004-12-17 Thread Iavor S. Diatchki
Hello, Duncan Coutts wrote: ... So while we would like to be able for users to do this: import Graphics.UI.Gtk ... Button.setLabel ... I don't think you can do things like this with the current module system. One possible extension that might solve this problem is to allow partial

Re: [Haskell-cafe] IO and State

2004-11-12 Thread Iavor S. Diatchki
Hello, Ben Rudiak-Gould wrote: ... I would say that the law holds in one direction and not the other. It's safe to replace do x - readSTRef r y - readSTRef r with do x - readSTRef r let y = x but not the other way around. How can things be equal the one way and not the other? I

Re: [Haskell-cafe] IO and State

2004-11-10 Thread Iavor S. Diatchki
this optimiziation in such situations. I think the law holds then, as I think no reference can escape to concurrent threads, as if they did their region parameter would become RealWorld, and so the computation could not be runSTed. -Iavor Graham Klyne wrote: At 10:38 08/11/04 -0800, Iavor S

[Haskell-cafe] IO and State (was Re: [Haskell] Re: Global Variables and IO initializers)

2004-11-08 Thread Iavor S. Diatchki
Hello, Just wanted to point out that the suggested idea is not quite correct. (well that has to be quantiifed a bit, see bellow) Krasimir Angelov wrote: --- Ben Rudiak-Gould [EMAIL PROTECTED] wrote: This is solved by merging the IO and ST monads, something that ought to be done anyway:

Re: Data.List.partition on infinite lists

2004-11-01 Thread Iavor S. Diatchki
hi, the foldr definition can be fixed by putting a ~ on the pattern in 'select'. -iavor Remi Turk wrote: On Sun, Oct 31, 2004 at 06:37:20PM +0100, Lemming wrote: I encountered that the implementation of 'partition' in GHC 6.2.1 fails on infinite lists: partition :: (a - Bool) - [a] -

Re: [Haskell-cafe] Optmiization of recursion

2004-09-28 Thread Iavor S. Diatchki
hello, John Goerzen wrote: Hello, As I'm investigating Haskell, it's occured to me that most of the Haskell tutorials out there have omitted something that was quite prominent in the OCaml material I had read: making functions properly tail-recursive. The OCaml compiler was able to optimize

Re: [Haskell-cafe] complete documentation like the one from Java or C++

2004-09-10 Thread Iavor S. Diatchki
hello, Fergus Henderson wrote: On 10-Sep-2004, Cale Gibbard [EMAIL PROTECTED] wrote: Just in case it's not what you're referring to, http://www.haskell.org/ghc/docs/latest/html/libraries/index.html together with the Haskell report http://www.haskell.org/onlinereport/ generally does the trick

Re: [Haskell-cafe] Relating functors in Category Theory to Functor

2004-07-02 Thread Iavor S. Diatchki
hello, i was thinking of higher-order functions, which i think complicate things (i might be wrong though :-) for example: fix :: (a - a) - a is ploymorphic, but is it a natural tranformation? i belive it is in fact a di-natural transformation. -iavor On Jun 29, 2004, at 6:46 PM, Iavor S. Diatchki

Re: [Haskell] Re: comment on language shootout

2004-06-18 Thread Iavor S. Diatchki
hi, of course it is not a _language_ shootout, but rather _language implementation_ shootout (actually not even that..., and yes, i agree that some of the tests are silly, or even non-sensical, e.g. list processing) it still has some interesting results though. for example it points out

[Haskell-cafe] Re: (to haskell-cafe) comment on language shootout

2004-06-18 Thread Iavor S. Diatchki
hello, Greg Morrisett wrote: Iavor S. Diatchki wrote: what would be cool is to have a place where one has many versions of the same program, but each written in the most natural way for the particular language --- a kind of rosetta stone for programming languages. The ICFP programming contest

Re: [Haskell-cafe] Modules and files

2004-06-14 Thread Iavor S. Diatchki
hello, according to the report there should be no connection between modules and files, and one should be able to have multiple modules in a file, and even a single module in multiple files. however none of the implementations support that, so in effect there is 1-1 correspondence between

Re: [Haskell] Implicit parameters

2004-06-09 Thread Iavor S. Diatchki
hi, i don't think this is a bug, and this is a situation where it matters if you use ($) or parens. the same probelm occurs when you work with polymorohism, rank-2 and above, e.g. when you use runST. the problem occurs because ($) has a monomorphic (non-overloaded) type: ($) :: (a - b) - (a - b)

Re: [Haskell-cafe] Join and it's relation to = and return

2004-06-08 Thread Iavor S. Diatchki
hi ron, here are the relations between the two formulations of monads: (using haskell notation) map f m = m = (return . f) join m = m = id m = f = join (fmap f m) there are quite a few general concepts that you need to understand in what sense monads are monoids, but to

Re: [Haskell-cafe] Data constructors

2004-04-26 Thread Iavor S. Diatchki
hi, i have thought about things like that, but the qualification Type.Constructor does not seem particularly useful. you can achieve the same by using _, e.g data A = A_X | A_Y data B = B_X | B_Y alternatively (at least for non-recursilve datatypes) anonymous sums (ala TREX's records) could

[Haskell] hirarchical module system qualifiers

2004-04-07 Thread Iavor S. Diatchki
hello, i have been using the hirarchical module system quite a bit lately, and i often find myself writing things like: import Syntax.Core.Struct as Struct import Utils.Set as Set etc. this is not a big bother, but it leads to clutter, and a few times i got errors, becasue i forgot to add the as

Re: [Haskell-cafe] Newbie: Is it possible to catch _|_ ?

2004-04-06 Thread Iavor S. Diatchki
hello, this is an attempt to give an answer to someone who is new to Haskell. the answer to your question is: no, there is no way to catch _|_, as that would mean that we can solve the halting problem. a piece of advice, especially while you are new to haskell --- don't worry too much about _|_.

Re: [Haskell] Mixing monadic and non-monadic functions

2004-03-23 Thread Iavor S. Diatchki
hi, at some level you are right that some more syntactic sugar and stuff could make monads more atracitve. for the time being here is how i'd write what you want bellow: f # m = liftM f m mx === my = liftM2 (==) m1 m2 assertBool fail $ (length # someFunc a) === (length # someFunc b) at

[Haskell] Re: DData revision /equivalence vs equality

2004-03-17 Thread Iavor S. Diatchki
hi , this is an interesting discussion and i agree that in general instances of Eq should be equality, but what do people mean by real equality? probably the most reasonable interpretation is some sort of observational equivalance, i.e. if two things are equal we should always be able to replace

Re: AW: [Haskell] Hugs Nov2003 X Nov2002

2004-03-16 Thread Iavor S. Diatchki
hi, i believe you should use fromIntegral :: (Integral a, Num b) = a - b Since Int is in the Integral class, and Float is in the Num class this should do exactly the job you need. For the other functions that were not working --- they were moved to the Char module, so you need to add import Char

[Haskell] natural numbers

2004-03-04 Thread Iavor S. Diatchki
for it. if that is not too much work could we have that in the library? i think it would be very useful. (i am trying to generate demand :-) it would also be useful to have finite natural numbers, ala C's unsigned int. -iavor -- == | Iavor S

Re: [Haskell-cafe] State Monad

2004-03-03 Thread Iavor S. Diatchki
? -iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki

[Haskell] definition of intersperse

2004-03-02 Thread Iavor S. Diatchki
:: a - [a] - [a] intersperse _ [] = [] intersperse sep (x:xs) = x : rest where rest [] = [] rest xs = sep : intersperse sep xs bye iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science

Re: [Haskell] RE: Hugs/GHC incompatibility

2004-02-03 Thread Iavor S. Diatchki
. [...] Simon Wolfgang ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell -- == | Iavor S. Diatchki, Ph.D. student | | Department

Re: [Haskell-cafe] Type Class Query

2004-02-03 Thread Iavor S. Diatchki
simply say type? -kzm -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki

Re: [Haskell-cafe] Puzzled by error with forall quantifier.

2004-02-02 Thread Iavor S. Diatchki
there? Cheers, Theo Norvell ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe -- == | Iavor S. Diatchki, Ph.D. student | | Department

Re: Hugs/GHC incompatibility

2004-01-21 Thread Iavor S. Diatchki
, the value at that index is undefined. Could this be fixed? Wolfgang ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell -- == | Iavor S. Diatchki, Ph.D. student

Re: Hugs/GHC incompatibility

2004-01-21 Thread Iavor S. Diatchki
: On 2004.01.21 15:03, Iavor S. Diatchki wrote: hi, not that it matters, but i think commonly when specifications say that something is undefined, that means that the behaviour can be whatever, i.e. the implementors can do what they like. this is not to be confused with the entity undefined defined

overlapping instances and modules

2004-01-14 Thread Iavor S. Diatchki
of `obs'': obs' = get this seems to indicate that the second instance is being used, but i cannot figure out why. am i doing something silly here? -iavor ps: i am not on the GHC users list so please cc me if you replay there -- == | Iavor S. Diatchki

bugs from n+k patterns (was: Re: Preventing/handling space leaks)

2003-12-11 Thread Iavor S. Diatchki
-- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki

Re: Preventing/handling space leaks

2003-12-10 Thread Iavor S. Diatchki
with its behaviour, or one can make the code lazy, but then is some situations it will leak. just my 2 stotinki. iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI

Re: How to best add logging/debugging code?

2003-11-18 Thread Iavor S. Diatchki
). it is more docuemnted then the current one, but otherwise it is very similar. bye iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU

Re: what's the deal with user error on fail?

2003-11-13 Thread Iavor S. Diatchki
is confusing to the user, because it the user's fault. Is there some other way that it is recommended one fail? Or should I be catching userErrors at the top level and failing with my own error message? -- == | Iavor S. Diatchki, Ph.D. student

Re: what's the deal with user error on fail?

2003-11-13 Thread Iavor S. Diatchki
designer doesn't explicitly add error support, the monad still supports errors. Jon Cast ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe -- == | Iavor S

Re: when is defaulting supposed to occur?

2003-10-25 Thread Iavor S. Diatchki
S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki

Re: Haskell help!

2003-03-25 Thread Iavor S. Diatchki
(--mad, compu) Main printSeq mad snowball (mad, sno) -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu

Re: Haskell help!

2003-03-25 Thread Iavor S. Diatchki
. -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki

Re: recursive modules in Haskell

2003-03-19 Thread Iavor S. Diatchki
of the simons can give us a more definitive answer on that. bye iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu

Re: recursive modules in Haskell

2003-03-17 Thread Iavor S. Diatchki
-- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki

Re: recursive modules in Haskell

2003-03-12 Thread Iavor S. Diatchki
-- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki

Re: Problem with hierarchical libraries.

2003-03-11 Thread Iavor S. Diatchki
be mapped to in the file system (e.g. _) i like the first one better. what does GHC do in this situation? bye iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU

Re: Persistant (as in on disk) data

2003-03-07 Thread Iavor S. Diatchki
efficient possible library. But (the possibility of an) efficient implementation has to be a goal, just not the only goal. If GHC can't use it directly for interface files, so be it. Simon -- == | Iavor S. Diatchki, Ph.D. student

Re: Parsec: GHC /= Hugs?

2003-03-04 Thread Iavor S. Diatchki
identify which of the two you think is doing something wrong and report it as a bug. bye iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU

Persistant (as in on disk) data

2003-03-04 Thread Iavor S. Diatchki
here the String is the name of the file where to store/load the data. so is there such a thing already, and if not would it be difficult to add to say GHC? bye iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer

Re: typing query

2003-02-21 Thread Iavor S. Diatchki
-- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki

Re: silly questions about 'seq'

2003-02-12 Thread Iavor S. Diatchki
information to evaluate haskell programs, so i don't think there is a problem there. hope this helped, and sorry for the long email bye iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering

Re: Beginner help

2003-02-11 Thread Iavor S. Diatchki
to the left, while foldr groups them to the right. hope this helped bye iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http

separate compilation [was Re: Global variables?]

2003-02-05 Thread Iavor S. Diatchki
it implemented in one of the projects i am currently working on. hopefully one day GHC will also dispense with the hi-boot files. bye iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering

Re: avoiding cost of (++)

2003-01-16 Thread Iavor S. Diatchki
/mailman/listinfo/haskell -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki

Implicit params [was Re: Record of STRefs better than STRef to a Record?]

2002-11-14 Thread Iavor S. Diatchki
mind the above two definitions are pretty much the same. bye iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu

Implicit params [was Re: Record of STRefs better than STRef to a Record?]

2002-11-14 Thread Iavor S. Diatchki
mind the above two definitions are pretty much the same. bye iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu

Report and web site

2002-11-12 Thread Iavor S. Diatchki
hi, now that the report is pretty much stable, are there any plans of putting it on the Haskell web site? bye iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI

Re: Module re-exportation weekend puzzler

2002-11-06 Thread Iavor S. Diatchki
-- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki

Re: Module re-exportation weekend puzzler

2002-11-05 Thread Iavor S. Diatchki
Hi, Simon Peyton-Jones wrote: Folks Another minor H98 glitch. Are you saying that you think the report doesn't fully define the meaning of the module system, or just that difficult to understand and needs to be clarified? Consider this: | module D (module Char) where | { import

Re: Main.main naming convention

2002-09-11 Thread Iavor S. Diatchki
flgas of GHC. bye iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki

Re: mutable records

2002-09-09 Thread Iavor S. Diatchki
. unfortunatelly with the Haskell module system approach you soon run into recursive modules (when objects depend on each other) and this is not well supported by Haskell implementations at the moment. bye iavor -- == | Iavor S. Diatchki, Ph.D. student

Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread Iavor S. Diatchki
. ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI

Re: what does fixST do?

2002-02-10 Thread Iavor S. Diatchki
hi, check out levent's page at: http://www.cse.ogi.edu/~erkok/rmb/ bye iavor ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

functional dependencies

2002-02-03 Thread Iavor S. Diatchki
hello, there seems to be a difference between the way superclasses are handled in GHC and Hugs, and it would be nice if one of the choices was selected (i am not sure what other implementations do). here is what i mean: class C a b | a - b class C a b = D a vs. class C a b | a - b class C a

Re: Another H'98 Report query

2002-01-31 Thread Iavor S. Diatchki
hi On Thursday 31 January 2002 03:53 am, Malcolm Wallace wrote: I see no reason to disallow duplicates at the subordinate level if they are permitted otherwise. Well, disallowing duplicates here may improve error detection, catching some unintentional typos and cut-and-paste errors.

Re: Another H'98 Report query

2002-01-31 Thread Iavor S. Diatchki
hi again, On Thursday 31 January 2002 10:18 am, Malcolm Wallace wrote: disallowing all duplicates seems tricky. is there a duplicate here: module A (f, module M) where import M(f) Yes, there is a duplicate here. Strangely enough, hbc does not report this as an error, even though it

punning in GHC?

2001-12-26 Thread Iavor S. Diatchki
hi there, i just discovered that GHC does not support punning with the -fglasgow-exts option. is there another flag to turn this on or has it been completely removed? if so could we have it back - i really like the feature (in patterns anyways) and use it (hugs -98 supports it). i don't

Re: Haskell 98 Revised

2001-12-04 Thread Iavor S. Diatchki
hello, it seems that if the qualified names in instance declarations are removed, the qualified methods (data constructors) in exports ought to be removed as well. example: currently in Haskell one may write module M ( P.C(Q.f) ) where import qualified P import qualified Q ... qualifying the

hiding imports

2001-12-04 Thread Iavor S. Diatchki
hello, i was wondering if there was a reasong why hiding imports have different semantics from importing imports and exports. what i mean is, if one writes: module A(T) where data T = T only the type constructor T is exported. simillarly if i write: module A where data T = T module B where

Re: not naming modules Main

2001-11-16 Thread Iavor S. Diatchki
://www.haskell.org/mailman/listinfo/haskell -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki

Re: rank 2-polymorphism and type checking

2001-10-23 Thread Iavor S. Diatchki
hi test :: (forall t . (forall a . t a) - t b) - b - b i am not an expert on this, but isnt this rank 3? bye iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI

Re: Reasons behind the one instance per type limitation

2001-10-09 Thread Iavor S. Diatchki
-- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki

Re: Haskell 98 Report: October release

2001-10-02 Thread Iavor S. Diatchki
not refer to the same entity. bye iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki

Re: Haskell98 undefinedness (exports of modules)

2001-09-11 Thread Iavor S. Diatchki
hello, although i don't think the report explicitly mentions it, i think the interpretations should be the same as with imports, namely that the export specs are comulative. with this interpretation, i'd say that C is exported, as the first B, just exports {B}, and B(..) exports {B,C}, so