Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-25 Thread Miguel Mitrofanov
On 25 Apr 2009, at 18:34, Xiao-Yong Jin wrote: Miguel Mitrofanov miguelim...@yandex.ru writes: On 24 Apr 2009, at 16:37, Loup Vaillant wrote: 2009/4/23 Miguel Mitrofanov miguelim...@yandex.ru: On 23 Apr 2009, at 12:17, Thomas Davie wrote: Haskell is a very horizontal language

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-25 Thread Miguel Mitrofanov
On 25 Apr 2009, at 19:08, Felipe Lessa wrote: On Sat, Apr 25, 2009 at 10:34:05AM -0400, Xiao-Yong Jin wrote: You don't write lisp, do you? Or probably it is just me. But I would prefer to write the line as newtype MyCoolMonad = MyCoolMonad (FirstTransformer

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-25 Thread Miguel Mitrofanov
On 25 Apr 2009, at 19:59, Felipe Lessa wrote: On Sat, Apr 25, 2009 at 07:38:59PM +0400, Miguel Mitrofanov wrote: Also, I don't mistake the transformers as different parameters because of the parenthesis You should really try Lisp. In my opinion, parenthesis are a kind of noise - too small

Re: [Haskell-cafe] Haskell/JS -- better through typeclasses?

2009-04-25 Thread Miguel Mitrofanov
On 25 Apr 2009, at 21:53, Jason Dusek wrote: Many Haskell/JS bridges provide libraries for writing complete JavaScript programs in Haskell; some of them even include jQuery. However, my goals are more limited -- I'd like to be able to take a Haskell module and turn it into a JavaScript

Re: [Haskell-cafe] compilation to C, not via-C

2009-04-24 Thread Miguel Mitrofanov
Have you considered using FFI? On 24 Apr 2009, at 20:36, Sam Martin wrote: Hi Everyone, It appears the GHC compiler (and other) compile Haskell *via-C* but not *to C*. I've never really understood why there isn't a C generation option, or why GDC ships with its own compulsory copy of gcc.

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-23 Thread Miguel Mitrofanov
On 23 Apr 2009, at 12:17, Thomas Davie wrote: On 23 Apr 2009, at 10:02, Matthijs Kooijman wrote: Some material I've read on typography -- can't find the reference now -- suggests ~65 is the best number of characters per line. The advice was, if your page is larger than that, you should make

Re: [Haskell-cafe] Overriding a Prelude function?

2009-04-23 Thread Miguel Mitrofanov
On 23 Apr 2009, at 23:07, Claus Reinke wrote: *Main :t rollDie ~ (rollDie ~ rollDie) rollDie ~ (rollDie ~ rollDie) :: Seed - (Int, Seed) This is a function. How exactly do you want ghci to show it? When you figure that out, feel free to make an instance of Show for it. Just because user

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-22 Thread Miguel Mitrofanov
On 22 Apr 2009, at 13:07, Jon Fairbairn wrote: Miguel Mitrofanov miguelim...@yandex.ru writes: Well, the problem is that every implementor does choose a subset of standart to implement. That's what I'm complaining about. And that's exactly what you (or anybody else) can't do anything

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-22 Thread Miguel Mitrofanov
On 22 Apr 2009, at 21:19, Jason Dusek wrote: 2009/04/22 Miguel Mitrofanov miguelim...@yandex.ru: It's arrogant and disrespectful on the part of the implementors to say that they know better than the committee what features should be part of the language. It's arrogant and disrespectful

Re: [Haskell-cafe] Re: Cabal's default install location

2009-04-21 Thread Miguel Mitrofanov
$ cat .cabal/config ... root-cmd: sudo ... user-install: False ... On 21 Apr 2009, at 14:41, Achim Schneider wrote: Thomas Davie tom.da...@gmail.com wrote: There seems to be an assumption amongst the community that a user's home directory is the most useful place for cabal to install to by

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-20 Thread Miguel Mitrofanov
I disagree. First of all, UHC states explicitly that some features are not supported (and probably never would be). Secondly, it seems like almost nobody uses (n+k)-patterns, and when they are used, they make the code less readable; so it's good NOT to support them, in order to make programmers

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-20 Thread Miguel Mitrofanov
Well, the problem is that every implementor does choose a subset of standart to implement. It's much worse in JavaScript - essential features working differently in Internet Explorer, Firefox, Opera, and Safari, and sometimes they even differ between versions; Web programmers still manage.

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-20 Thread Miguel Mitrofanov
bad. On Mon, Apr 20, 2009 at 1:23 PM, Miguel Mitrofanov miguelim...@yandex.ru wrote: Well, the problem is that every implementor does choose a subset of standart to implement. It's much worse in JavaScript - essential features working differently in Internet Explorer, Firefox, Opera, and Safari

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-20 Thread Miguel Mitrofanov
On 21 Apr 2009, at 04:59, Richard O'Keefe wrote: On 20 Apr 2009, at 10:12 pm, Miguel Mitrofanov wrote: I disagree. First of all, UHC states explicitly that some features are not supported (and probably never would be). Secondly, it seems like almost nobody uses (n+k)-patterns, How can

Re: [Haskell-cafe] Code Golf

2009-04-15 Thread Miguel Mitrofanov
What about diag [[1,2,3],[4],[5,6,7]] ? What it should be? Sebastian Fischer wrote on 15.04.2009 15:28: Prelude let diag = concat . diags where diags ((x:xs):xss) = [x] : zipWith (:) xs (diags xss) this has a different semantics on finite lists, so I should add a test case: *Main diag

Re: [Haskell-cafe] error handling (esp. IO/exceptions)

2009-04-14 Thread Miguel Mitrofanov
What about ErrorT monad transformer? Well, if it's not what you really want, you can define your own one without ugly Error class, so it'd be something like execute :: FilePath - [String] - MyCoolErrorT ExecuteError IO ExitCode On 14 Apr 2009, at 23:29, br...@lorf.org wrote: I'm finding it

Re: [Haskell-cafe] Referential Transparency and Monads

2009-04-09 Thread Miguel Mitrofanov
On 10 Apr 2009, at 06:30, Jonathan Cast wrote: do s - readFile /my_file writeFile /my_file Hello, world!\n threadDelay 1 -- If you don't like threadDelay, just substitute forcing -- an expensive thunk here writeFile /my_file s As a function from

Re: [Haskell-cafe] high probability of installation problems and quality of the glorious implementation

2009-04-05 Thread Miguel Mitrofanov
What about 6.10.1? Is it failing too? On 5 Apr 2009, at 22:22, FFT wrote: I'm still learning Haskell and also evaluating whether I want to use the language in my work. It seems like a fascinating language so far (although I don't know if laziness will be a detriment later for me eventually),

Re: [Haskell-cafe] ANN: cmonad 0.1.1

2009-03-30 Thread Miguel Mitrofanov
As it goes, it'd probably be Forth. On 30 Mar 2009, at 21:29, Edward Kmett wrote: First, BASIC, now C. What's next, Haskell? =) -Edward Kmett On Sun, Mar 29, 2009 at 5:16 AM, Lennart Augustsson lenn...@augustsson.net wrote: I've uploaded my CMonad package to Hackage. It allows you to

Re: [Haskell-cafe] Rational and % operator remix

2009-03-29 Thread Miguel Mitrofanov
cf2 a = let ai = floor a air = toRational ai in ai : if a == air then [] else cf2 (1 / (a - air)) On 30 Mar 2009, at 00:19, michael rice wrote: I'm a Lisper, kind of feeling my way around here in Haskell, so please bear with me. I did the things you suggested, but I

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Miguel Mitrofanov
Well, I'd say that there is something close to the Perl syndrome, in some sense. After all, code IS usually very smart. The difference is that in Perl all smartness is about knowing how the computer works, or how the interpreter works. In Haskell, instead, the smartness is about knowing -

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Miguel Mitrofanov
| As an example, with the takeList function I posted. I looked at it, found nothing wrong with the original, and absolutely hated your fixed version. I might have written it like this, instead: ~buildPartitions xs ns = zipWith take ns . init . scanl (flip drop) xs $ ns Maybe it's

Re: [Haskell-cafe] Hugs on iPhone

2009-03-23 Thread Miguel Mitrofanov
me to upgrade. On 23 Mar 2009, at 21:00, Kirk Martinez wrote: I saw Miguel Mitrofanov (http://www.nabble.com/Hugs-on-the-iphone-td19478992.html ) successfully ported Hugs to the iPhone. I'm now wondering if anyone has tried to get Apple's blessing to put this in the App Store? It would

Re: [Haskell-cafe] Hugs on iPhone

2009-03-23 Thread Miguel Mitrofanov
On 23 Mar 2009, at 21:38, David Leimbach wrote: On Mon, Mar 23, 2009 at 11:22 AM, Miguel Mitrofanov miguelim...@yandex.ru wrote: 1) You'll need a terminal application first, and I'm not sure if there is one in AppStore. In fact, I AM sure there isn't. There's SSH terminal programs like

Re: [Haskell-cafe] Hugs on iPhone

2009-03-23 Thread Miguel Mitrofanov
iphone to do this stuff. Dave On Mon, Mar 23, 2009 at 2:46 PM, Miguel Mitrofanov miguelim...@yandex.ru wrote: On 23 Mar 2009, at 21:38, David Leimbach wrote: On Mon, Mar 23, 2009 at 11:22 AM, Miguel Mitrofanov miguelim...@yandex.ru wrote: 1) You'll need a terminal application first

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-20 Thread Miguel Mitrofanov
No, you don't. On 20 Mar 2009, at 21:03, Martijn van Steenbergen wrote: Don Stewart wrote: Yes, anything that is relevant to the development experience on this platform. Remember: it is more than just getting ghc. How do they get hold of new libraries and apps? Is cabal-install available?

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-20 Thread Miguel Mitrofanov
MacPort developers tweak sources into packages which can install by themselves. So one just types sudo port install ghc and it does the rest. Here is info about ghc: $ port info ghc ghc 6.8.3, Revision 1, lang/ghc (Variants: universal, darwin_6, darwin_7, darwin_8_powerpc, darwin_8_i386,

Re: [Haskell-cafe] Haskell Logo Voting has started!

2009-03-17 Thread Miguel Mitrofanov
The first glimpse of this vote scared me so much that I've closed the page, stopped the browser and shut my computer down. On 17 Mar 2009, at 16:06, Eelco Lempsink wrote: Hi there! I updated a couple of logo versions and ungrouped and regrouped the (former) number 31. Other than that,

Re: [Haskell-cafe] Hand calculation of Bird's definition of zip using foldr

2009-03-12 Thread Miguel Mitrofanov
zip [1,2,3] [4,5,6] = zip (1:2:3:[]) (4:5:6:[]) = foldr f e (1:2:3:[]) (4:5:6:[]) = f 1 (foldr f e (2:3:[])) (4:5:6:[]) = (1, 4) : foldr f e (2:3:[]) (5:6:[]) = (1, 4) : f 2 (foldr f e (3:[])) (5:6:[]) = (1, 4) : (2, 5) : foldr f e (3:[]) (6:[]) = (1, 4) : (2, 5) : f 3 (foldr f e [])

Re: [Haskell-cafe] Does anybody dislike implicit params as much as I do?

2009-03-12 Thread Miguel Mitrofanov
There is an old joke in Russia: - I don't like cats. - You just don't know how to cook them. Well, maybe, you don't know how to cook implicit parameters? Anyway, what about type classes - aren't they a sort of implicit parameters? On 12 Mar 2009, at 23:36, Thomas Hartman wrote:

Re: [Haskell-cafe] *almost* composition in writer monad

2009-03-04 Thread Miguel Mitrofanov
Isn't that sequence in State monad? On 4 Mar 2009, at 19:37, Edsko de Vries wrote: Hi, Does this function remind anybody of anything? It seems like I'm missing an obvious abstraction: composeWriter :: [a - (a, b)] - a - (a, [b]) composeWriter [] a = (a, []) composeWriter (f:fs) a = let

Re: [Haskell-cafe] Re: statep haskell-lang [was: Re: Hoogle and Network.Socket]

2009-02-26 Thread Miguel Mitrofanov
Believe it or not, but I still edit Haskell sources with vi sometimes. My favorite Emacs doesn't work on iPhone. On 26 Feb 2009, at 23:18, John A. De Goes wrote: Are you saying has been no progress since KR C in the number of libraries available to C programmers? And that C programmers

Re: [Haskell-cafe] Status of Haskell under OsX

2009-02-25 Thread Miguel Mitrofanov
I've got an iMac; ghc from MacPorts seems to work fine. On 25 Feb 2009, at 22:37, Cristiano Paris wrote: Hi, I'm planning to purchase a MacBookPro so I'm wondering how well Haskell is supported under this platform. Thanks, Cristiano ___

Re: [Haskell-cafe] speed: ghc vs gcc

2009-02-20 Thread Miguel Mitrofanov
Ahem. Seems like you've included time spent on the runtime loading. My results: MigMit:~ MigMit$ gcc -o test -O3 -funroll-loops test.c time ./test -1243309312 real0m0.066s user0m0.063s sys 0m0.002s MigMit:~ MigMit$ rm test; ghc -O2 --make test.hs time ./test Linking test ...

Re: [Haskell-cafe] speed: ghc vs gcc

2009-02-20 Thread Miguel Mitrofanov
Forget it, my bad. On 20 Feb 2009, at 16:48, Miguel Mitrofanov wrote: Ahem. Seems like you've included time spent on the runtime loading. My results: MigMit:~ MigMit$ gcc -o test -O3 -funroll-loops test.c time ./test -1243309312 real0m0.066s user0m0.063s sys 0m0.002s MigMit

Re: [Haskell-cafe] Uses of `fix' combinator

2009-02-19 Thread Miguel Mitrofanov
Each data type in Haskell contains one element, which is usually invisible. It's called bottom and denoted by (_|_). Naturally (_|_) of type Int and (_|_) of type Char are different; however, they are denoted as if they are the same, 'cause there isn't much difference between them. Anyway,

Re: [Haskell-cafe] Type families not as useful over functions

2009-02-12 Thread Miguel Mitrofanov
What do you need that for? Can you live with infixl |$| (|$|) :: [a - r] - a - [r] fs |$| x = map ($ x) fs and, instead of broadcast fs a b use fs |$| a |$| b ? On 13 Feb 2009, at 02:34, John Ky wrote: Hi Haskell Cafe, I tried using type families over functions, but when I try it

Re: [Haskell-cafe] Define variable types

2009-02-05 Thread Miguel Mitrofanov
Note also that Helium ISN'T Haskell; it lacks hell of a lot of Haskell98 features (not to mention common extensions). 05.02.09, 14:57, Roman Cheplyaka r...@ro-che.info: * Tsunkiet Man temp.t...@gmail.com [2009-02-05 12:37:22+0100] Hello, I'm new to Haskell and it seems like a very nice

Re: [Haskell-cafe] Re: evaluation semantics of bind

2009-02-05 Thread Miguel Mitrofanov
Let's put it this way: suppose you have two data types, say, Int and String; a value s of type String and a function f :: String - (Int - String) - String This could be anything - may be, a function which looks for the first character '#' in it's first argument and replaces it with the

Re: [Haskell-cafe] Monad explanation

2009-02-05 Thread Miguel Mitrofanov
Ahem... WHAT??? IO monad is impure??? What do you mean? On 5 Feb 2009, at 22:25, Andrew Wagner wrote: I think the point of the Monad is that it works as a container of stuff, that still allows mathematically pure things to happen, while possibly having some opaque other stuff going on.

Re: [Haskell-cafe] Signatures in defining functions

2009-02-05 Thread Miguel Mitrofanov
It means Int - (Int - Int). - is right associative. On 6 Feb 2009, at 01:28, TKM wrote: Hello, I'm kind of new with Haskell and I would like to know about the following: [some function]:: Int - Int - Int Now is my question, how should I interpret Int - Int - Int? Meaning what does Int

Re: [Haskell-cafe] morphisms in IO

2009-02-05 Thread Miguel Mitrofanov
On 6 Feb 2009, at 05:52, Gregg Reynolds wrote: I'm working on a radically different way of looking at IO. Before I post it and make a fool of myself, I'd appreciate a reality check on the following points: a) Can IO be thought of as a category? I think the answer is yes. What couldn't?

Re: [Haskell-cafe] ANN: filestore 0.1

2009-01-25 Thread Miguel Mitrofanov
Maybe, we should have another command in cabal-install, something like cabal announce, that would post an announcement to hask...@haskell.org? On 26 Jan 2009, at 01:09, Magnus Therning wrote: On Sun, Jan 25, 2009 at 10:47 AM, Derek Elkins derek.a.elk...@gmail.com wrote: On Sun, 2009-01-25

Re: [Haskell-cafe] Re: Laws and partial values

2009-01-24 Thread Miguel Mitrofanov
On 25 Jan 2009, at 00:11, Thomas Davie wrote: I'm coming at this from the point of view that bottom would contain all the information we could possibly know about a value while still being the least value in the set. Note that we can't possibly know what information can we possibly know

Re: [Haskell-cafe] How to define an operation in terms of itself (but of different type)?

2009-01-23 Thread Miguel Mitrofanov
Seems like all telepath are on vacation, so you would have to show the code. On 24 Jan 2009, at 01:15, Olex P wrote: Hello Haskellers! It's probably a simple question but I can't find a proper solution... Suppose we have a class Vector which overloads (+) operation. I'd like to represent a

Re: [Haskell-cafe] How to define an operation in terms of itself (but of different type)?

2009-01-23 Thread Miguel Mitrofanov
On 24 Jan 2009, at 01:35, Jonathan Cast wrote: On Sat, 2009-01-24 at 01:30 +0300, Miguel Mitrofanov wrote: Seems like all telepath are on vacation, Now, now, you didn't let enough time elapse to know that for sure. They're always on vacation when you need one

Re: [Haskell-cafe] Haskell mode for Emacs question

2009-01-22 Thread Miguel Mitrofanov
On my Mac I've had the same problem. Commenting out lines (unless (equal default-directory root) (setq default-directory root) (inferior-haskell-send-command proc (concat :cd default-directory))) solved it for me. On 22 Jan 2009, at 20:23,

Re: [Haskell-cafe] Haskell mode for Emacs question

2009-01-22 Thread Miguel Mitrofanov
Oops, sorry, forgot to mention that lines worth commenting were in inf-haskell.el file. On 22 Jan 2009, at 20:23, Andrew Wagner wrote: Interesting. I have a similar, but worse problem. For me, ':load'ing main.hs would fail to find the imported files. The only thing I appear to be able to

Re: Re[2]: [Haskell-cafe] Haskell mode for Emacs question

2009-01-22 Thread Miguel Mitrofanov
http://depositfiles.com/files/4565hs7vl On 22 Jan 2009, at 21:14, Bulat Ziganshin wrote: Hello John, Thursday, January 22, 2009, 8:50:39 PM, you wrote: thanks, support of over-internet and intranet collaboration looks very promising these days (even if not saying about ability to highlight

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Miguel Mitrofanov
I'd prefer something like Sum :: Monoid Integer Sum = Monoid {mappend = (+), mempty = 0} Prod :: Monoid Integer Prod = Monoid {mappend = (*), mempty = 1} instance Sum in [some code using mempty and mappend] On 19 Jan 2009, at 23:18, Alberto G. Corona wrote: This is one of the shortcomings of

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Miguel Mitrofanov
For what it's worth, many (most/all?) programmers I know in person don't have the slightest clue about Category Theory and they may have known about abstract algebra once upon a time but certainly don't remember any of it now. They usually understand the concepts perfectly well enough but

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Miguel Mitrofanov
Notice that monoid sounds almost *exactly* like monad. And yet, what you use them for is wildly unrelated. Well, monads are monoids. I remember explaining you that... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Miguel Mitrofanov
. I see how the subset of Kleisli arrows (a - m a) forms a monoid (a, return . id, =), but what to do with (a - m b)? (=) is not closed under this larger set. Dan Miguel Mitrofanov wrote: Notice that monoid sounds almost *exactly* like monad. And yet, what you use them for is wildly

Re: [Haskell-cafe] some ideas for Haskell', from Python

2009-01-14 Thread Miguel Mitrofanov
Well, like many good programming tools, Lisp macros are another abstraction, but instead of dealing with data, they deal with code. I didn't know Lisp puts such an emphasis on the difference between code and data. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: Monads aren't evil

2009-01-11 Thread Miguel Mitrofanov
Indeed but what's wrong in writing x + y (with additional spaces) ? Having the possiblity to write for instance +blah instead of inventing things such as $* is neat in my opinion (in code or for typesetting)... I believe it was Bulat Ziganshin who once proposed parsing x + y*z + t

Re: [Haskell-cafe] Propositional logic implementation

2009-01-10 Thread Miguel Mitrofanov
Look at SYB (Data.Data, Data.Generics.*). For example, your symbols function can be rewritten as symbols :: Sentence - [Symbol] symbols s = nub $ listify (const True) s true is not that simple, because this code is NOT boilerplate - each alternative is valuable by itself. On 10 Jan 2009,

Re: [Haskell-cafe] ANNOUNCE: haskell-src-exts 0.4.8

2009-01-09 Thread Miguel Mitrofanov
On 9 Jan 2009, at 03:51, Niklas Broberg wrote: - Support for Unicode symbols for e.g. -. Fixing that would require me to have a Unicode-compliant editor, which it appears I don't. And I couldn't have someone else submit a patch either, since then I couldn't open the file anymore in my editor.

Re: [Haskell-cafe] Inconsistency in support for phantom types?

2009-01-08 Thread Miguel Mitrofanov
On 8 Jan 2009, at 23:11, DavidA wrote: inv :: IntegerAsType n = Fp n - Fp n ^ ^ ^ this n --+---+---| inv 0 = error Fp,inv 0 inv (Fp x) = let p = value (undefined :: n) ^ and this one

Re: [Haskell-cafe] advanced class constraints in Haskell 98?

2009-01-08 Thread Miguel Mitrofanov
On 8 Jan 2009, at 23:59, Henning Thielemann wrote: GHC accepts a class declaration like class Monad (m Maybe) = C m where ... without having any language extension switched on. But it isn't Haskell 98, is it? It is. From Report: A class assertion has form

Re: [Haskell-cafe] advanced class constraints in Haskell 98?

2009-01-08 Thread Miguel Mitrofanov
On 9 Jan 2009, at 02:47, Ross Paterson wrote: On Thu, Jan 08, 2009 at 10:27:59PM +0100, Henning Thielemann wrote: A nice. I jumped into 4.3 and found scontext - simpleclass | (simpleclass_1, ..., simpleclass_n) simpleclass - qtycls tyvar So it must be 'atype' instead of 'tyvar'?

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-04 Thread Miguel Mitrofanov
On 4 Jan 2009, at 07:11, Thomas DuBuisson wrote: My proposal would be for each selector name to be a special type of phantom type class (existing in the intermediate language only). This type class would not be accessible by the programmer and thus s/he couldn't make a polymorphic function for

Re: [Haskell-cafe] Beginner question

2009-01-02 Thread Miguel Mitrofanov
On 2 Jan 2009, at 19:57, Benjamin Bach wrote: Supposing I have the following code: module Main(main) where main = putStr (show []) What type is your [] here? main :: IO () putStr :: String - IO () show [] :: String show :: Show a = a - String Now, how is Hugs or GHCi supposed to

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-02 Thread Miguel Mitrofanov
module Element where import QName import ... data Element = Element {name :: QName, attribs :: [Attr], content :: [Content], line :: Maybe Line} module Attr where import QName import ... data Attr = Attr {key :: QName, val :: String} module QName where import ... data QName = QName {name ::

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-02 Thread Miguel Mitrofanov
module Main where import qualified QName as Q import qualified Element as E ... Q.name ... E.name ... I'm using this pattern of writing code and, so far, I find it very convenient. Yet, the code is likely to be spread across lots of files, which is not always a Good Thing. That's a

Re: [Haskell-cafe] Maintaining laziness

2008-12-29 Thread Miguel Mitrofanov
Seems useful. BTW, why on earth should inits undefined be undefined instead of []:undefined? I mean, come on, we all know that inits anything starts with []! On 29 Dec 2008, at 20:41, Henning Thielemann wrote: In case someone cares - after some battles with functions that are less

Re: [Haskell-cafe] Typeclass question

2008-12-27 Thread Miguel Mitrofanov
Seems like you want an existential type: data Foo = forall a. Bar a = Foo a Bool On 27 Dec 2008, at 22:24, Andrew Wagner wrote: I'm sure there's a way to do this, but it's escaping me at present. I want to do something like this: data Foo = Bar a = Foo a Bool ... That is, I want to create

Re: [Haskell-cafe] Typeclass question

2008-12-27 Thread Miguel Mitrofanov
There is a disadvantage in GADTs. They don't work in Hugs. On 27 Dec 2008, at 22:49, Luke Palmer wrote: On Sat, Dec 27, 2008 at 12:44 PM, David Menendez d...@zednenem.com wrote: On Sat, Dec 27, 2008 at 2:24 PM, Andrew Wagner wagner.and...@gmail.com wrote: I'm sure there's a way to do this,

Re: [Haskell-cafe] Typeclass question

2008-12-27 Thread Miguel Mitrofanov
Oh! That's much simplier: data Bar a = Foo a = Foo a Bool On 27 Dec 2008, at 23:09, Andrew Wagner wrote: Hmm, I actually simplified my problem too much. What I actually want is: data Foo a = forall a. Bar a = Foo a Bool ...except I want the 'a' on the left to match the 'a' on the right,

Re: [Haskell-cafe] Re: Time for a new logo?

2008-12-24 Thread Miguel Mitrofanov
You have to be unnecessarily strict to read the whole word Haskell and not just first one or two letters. On 24 Dec 2008, at 10:13, Colin Paul Adams wrote: There are a lot of nice designs on the new_logo_ideas page. My favourite by far is Conal's. One thing I noticed - everyone seems to

Re: [Haskell-cafe] Defining a containing function on polymorphic list

2008-12-22 Thread Miguel Mitrofanov
On 22 Dec 2008, at 17:35, Raeck Zhao wrote: But I just found another 'problem', I just realize that the list does not support the user-defined data type? Don't worry, it does. the list is also depending on the Eq function? No, it doesn't. data Shape = Square | Triangle | Circle

Re: [Haskell-cafe] monad constraint + record update

2008-12-22 Thread Miguel Mitrofanov
You can use a continuation trick I describe below. First of all, I would like to work in a more general situation. So, instead of working with Set, I'd like to declare two classes: class Returnable m a where ret :: a - m a and class Bindable m a b where bind :: m a - (a - m b) - m b I'm

Re: [Haskell-cafe] Re: Time for a new logo?

2008-12-21 Thread Miguel Mitrofanov
BTW, in Russian the character X (pronounced a bit like English H) is the first letter in Haskell. On 21 Dec 2008, at 21:48, Brandon S. Allbery KF8NH wrote: On 2008 Dec 17, at 8:42, Darrin Thompson wrote: X monad could have a variant of this logo too. X= (That's how I originally thought of

Re: [Haskell-cafe] Beginner's TH question

2008-12-20 Thread Miguel Mitrofanov
Seems like GHC had already told you what's wrong. Instance declarations like instance UIState t are illegal without FlexibleInstances language feature enabled. Also, I don't quite understand, what you're trying to achieve; argument t and the letter t in the TH body are two different

Re: [Haskell-cafe] Coroutines

2008-12-18 Thread Miguel Mitrofanov
First thing I've tried when learning Ruby was something like that: def a yield {puts 1} end a {yield} It didn't work. Can Coroutine.hs do something like that? On 18 Dec 2008, at 13:26, Ryan Ingram wrote: On Thu, Dec 18, 2008 at 2:00 AM, Nicolas Pouillard

Re: [Haskell-cafe] Time for a new logo?

2008-12-16 Thread Miguel Mitrofanov
Sorry to disappoint you, but the tree is not the very first thing that comes to mind when you look at this drawing. And, despite that it satisfies Don's condition to be mature (though adult would be a better word), this kind of pornography is NOT, I believe, what most of us want for a

Re: [Haskell-cafe] Reading showables

2008-12-07 Thread Miguel Mitrofanov
Given two different types T1 and T2, it's possible to have two different results of let {x :: T1; x = read s} in show x and let {x :: T2; x = read s} in show x so that neither of two reads fails. For example let {x :: Int; x = read 1} in show x produces the answer

Re: [Haskell-cafe] Permutations

2008-11-30 Thread Miguel Mitrofanov
import Data.List eqPerms [] = [[]] eqPerms xs = [x:xt | x - nub xs, xt - eqPerms $ delete x xs] On 30 Nov 2008, at 18:03, Andrew Coppin wrote: OK, so here's something just for fun: Given a list of items, find all possible *unique* permutations of that list. (E.g., the input list is

Re: [Haskell-cafe] Permutations

2008-11-30 Thread Miguel Mitrofanov
First line is necessary, because the second line is written in assumption that the first element of a permutation does really exist. On 30 Nov 2008, at 19:49, Andrew Coppin wrote: Miguel Mitrofanov wrote: eqPerms [] = [[]] eqPerms xs = [x:xt | x - nub xs, xt - eqPerms $ delete x xs] Well

Re: [Haskell-cafe] Re: howto tuple fold to do n-ary cross product?

2008-11-30 Thread Miguel Mitrofanov
Tuples would still be distinguishable from lists, since cons changes their type: (b,c,d) and (a,b,c,d) would have different types, while [b,c,d] and [a,b,c,d] wouldn't. On 30 Nov 2008, at 20:48, Brandon S. Allbery KF8NH wrote: On 2008 Nov 30, at 12:43, Max Rabkin wrote: On Sun, Nov 30,

Re: [Haskell-cafe] Instances that shouldn't overlap

2008-11-26 Thread Miguel Mitrofanov
Maybe it'd be more intuitive if written backwards: AppEq f a = (Applicative f, Eq a) or even AppEq f a = (Applicative f, Eq a) On 27 Nov 2008, at 00:39, Ryan Ingram wrote: A common mistake (and a confusing bit about typeclasses) is that whether or not the constraints on an instance apply

Re: [Haskell-cafe] Re: number of references to a variable

2008-11-01 Thread Miguel Mitrofanov
On 1 Nov 2008, at 16:33, Achim Schneider wrote: Alberto G. Corona [EMAIL PROTECTED] wrote: Is there a way to know the number of memory references for a variable?. The runtime must know it but i do not know if this available for the program trough any low level trick Flameproof vests,

Re: [Haskell-cafe] Problem with haddock 2.3.0

2008-10-27 Thread Miguel Mitrofanov
What the ..? Is that some sort of a virus? On 28 Oct 2008, at 01:05, Fegaras, Leonidas wrote: You have received a secure message Read your secure message by opening the attachment, securedoc.html. You will be prompted to open (view) the file or save (download) it to your computer. For

Re: [Haskell-cafe] A heretic question

2008-10-19 Thread Miguel Mitrofanov
On 20 Oct 2008, at 01:08, Achim Schneider wrote: I'm asking 'cos I'm learning C++ and can't get the proper motivation to do any program I can think of in it: If I need abstraction, I'm thinking Haskell or Scheme, and if I'm thinking performance, C itself more than suffices. Seems like

Re: [Haskell-cafe] Still stacking monad transformers

2008-10-12 Thread Miguel Mitrofanov
On 12 Oct 2008, at 21:08, Andrew Coppin wrote: I found that by using the brief and easily memorable construction runIdentity $ runListT $ runStateT foo state I can get at the result set for each action, and combine them. But nothing in hell seems to transform this from [((), MyState)]

Re: [Haskell-cafe] Darcs / Git

2008-10-07 Thread Miguel Mitrofanov
On 7 Oct 2008, at 12:11, Krasimir Angelov wrote: I use darcs on Windows every day and it works well. The only problem is that it is not very usable if you access your repository via SSH and the authentication is via password. Why not? It worked fine for me.

Re: [Haskell-cafe] Darcs / Git

2008-10-07 Thread Miguel Mitrofanov
Yes, I've used SSH key. Didn't think it would be different with a password. On 7 Oct 2008, at 20:19, Mitchell, Neil wrote: I use darcs on Windows every day and it works well. The only problem is that it is not very usable if you access your repository via SSH and the authentication is

Re: [Haskell-cafe] Health effects

2008-10-03 Thread Miguel Mitrofanov
On 3 Oct 2008, at 23:50, Andrew Coppin wrote: For what it's worth, 80% of my diet is cheese, and 10% is chocolate. Remind me not to take food out of your hands, OK? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] (A little humour)

2008-09-26 Thread Miguel Mitrofanov
I think you might be interested in http://www.research.att.com/~bs/whitespace98.pdf On 26 Sep 2008, at 22:39, Andrew Coppin wrote: Apparently C++ lets you overload the arithmetic operators, the assignment operator, the initialisation and destruction operators, the pointer dereference

Re: [Haskell-cafe] (A little humour)

2008-09-26 Thread Miguel Mitrofanov
that it was a joke, saw the last line, and then had to go back and read the whole thing again. Just awesome. On Fri, Sep 26, 2008 at 3:22 PM, Andrew Coppin [EMAIL PROTECTED] wrote: Miguel Mitrofanov wrote: I think you might be interested in http://www.research.att.com/~bs/whitespace98.pdf Thankyou

Re: [Haskell-cafe] Float instance of 'read'

2008-09-16 Thread Miguel Mitrofanov
On 16 Sep 2008, at 16:29, Mauricio wrote: I'm happy to finaly use a language where I can use words of my language to name variables, so I wonder if we could also make that step. Really? There is a bunch of languages (like Glagol) that use words of Russian language as keywords; AFAIK there

Re: [Haskell-cafe] Hugs on the iphone

2008-09-15 Thread Miguel Mitrofanov
? On 15/09/2008, at 7:24, Miguel Mitrofanov [EMAIL PROTECTED] wrote: Did that. http://migmit.vox.com/library/photo/6a00e398c5c26f000500fa9696d8c40002.html On 14 Sep 2008, at 14:17, Alberto R. Galdo wrote: Hi, is there any chance of having hugs compile for the iPhone? Cross-compiling? Compiling

Re: [Haskell-cafe] Hugs on the iphone

2008-09-14 Thread Miguel Mitrofanov
As pie. Just downloaded the source and compiled it on iPhone itself (no cross-compiling). On 15 Sep 2008, at 09:25, Don Stewart wrote: Very nice. Easy? miguelimo38: Did that. http://migmit.vox.com/library/photo/6a00e398c5c26f000500fa9696d8c40002.html On 14 Sep 2008, at 14:17, Alberto R.

Re: [Haskell-cafe] Hugs on the iphone

2008-09-14 Thread Miguel Mitrofanov
Did that. http://migmit.vox.com/library/photo/6a00e398c5c26f000500fa9696d8c40002.html On 14 Sep 2008, at 14:17, Alberto R. Galdo wrote: Hi, is there any chance of having hugs compile for the iPhone? Cross-compiling? Compiling directly on the iPhone? Greets, Alberto

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Miguel Mitrofanov
Well, I was thinking that way when I was starting learning Haskell. But then I realized that this feature would make code much harder to read. Suppose you have different thing all named insertWith. You've got one somewhere in your program; how do YOU know when looking at the code after a

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Miguel Mitrofanov
Erm... Why can't we? On 1 Sep 2008, at 00:43, Gwern Branwen wrote: I think we've all experienced importing Data.Map or Data.ByteString and discovering we need to tediously write it out in *full*, because we can't even do qualified imports of it! -- gwern BND fritz FKS 1071 Face

Re: [Haskell-cafe] language proposal: ad-hoc overloading

2008-08-31 Thread Miguel Mitrofanov
Oh, sorry, haven't noticed you said ghcI. On 1 Sep 2008, at 00:59, Miguel Mitrofanov wrote: Erm... Why can't we? On 1 Sep 2008, at 00:43, Gwern Branwen wrote: I think we've all experienced importing Data.Map or Data.ByteString and discovering we need to tediously write it out in *full

Re: [Haskell-cafe] Syntax of 'do'

2008-08-29 Thread Miguel Mitrofanov
-XNoImplicitPrelude ? On 29 Aug 2008, at 17:41, MaurĂ­ cio wrote: Hi, http://haskell.org/haskellwiki/Keywords says that: - [do is a] syntactic sugar for use with monadic expressions. For example: do { x ; result - y ; foo result } is shorthand for: x y = \result - foo result

Re: [Haskell-cafe] xmonad on the openmoko mobile phone

2008-08-10 Thread Miguel Mitrofanov
On 9 Aug 2008, at 23:43, Don Stewart wrote: Haskell on the iphone next? Did that. Hugs compiles well; GHC will probably too, I just didn't have time for this. No haskell-specific hacks, only jailbreak. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] [Off-topic] Loss of humour

2008-07-23 Thread Miguel Mitrofanov
Also... the current Humour page on the Haskell wiki contains a link to Lambdabot's quotes database, but on my system, clicking this link just displays a few hundred pages of gibberish. Is this normal? Of course it's not. But deciphering is very simple, it's named gunzip.

Re: [Haskell-cafe] [Off-topic] Loss of humour

2008-07-23 Thread Miguel Mitrofanov
On 24 Jul 2008, at 00:45, Andrew Coppin wrote: Miguel Mitrofanov wrote: Also... the current Humour page on the Haskell wiki contains a link to Lambdabot's quotes database, but on my system, clicking this link just displays a few hundred pages of gibberish. Is this normal? Of course

<    1   2   3   4   5   >