Re: [Haskell-cafe] Poll: Do you want a mascot?

2011-11-24 Thread Victor Nazarov
-- Work is punishment for failing to procrastinate effectively. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Victor Nazarov

Re: [Haskell-cafe] Tupling functions

2011-09-14 Thread Victor Nazarov
) = a ttail (a, b, c) = (b, c) tcons a (b, c) = (a, b, c) tupleF t a = thead t a `tcons` tupleF (ttail t) a -- Victor Nazarov ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Why the reluctance to introduce the Functor requirement on Monad?

2011-07-26 Thread Victor Nazarov
(runReader m r)) r deriving (Functor) So syntax changes are very minor. -- Victor Nazarov ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library

2011-02-23 Thread Victor Nazarov
Monoid Hash where mempty = Hash 0 Hash a `mappend` Hash b = Hash (a `combine` b) class Eq a = Hashable a where hash :: a - Hash hashWithSalt :: Hash - a - Hash hashWithSalt salt x = salt `mappend` hash x -- Victor Nazarov

Re: [Haskell-cafe] [ANNAUNCE] ghcjs-0.1.0 Haskell to Javascript compiler

2010-10-28 Thread Victor Nazarov
On Wed, Oct 27, 2010 at 7:46 PM, Martijn Schrage mart...@oblomov.com wrote: On 27-10-10 16:20, Victor Nazarov wrote: Very cool. I'll incorporate your changes, If you don't mind. Not at all. However, I have some minor remarks. You shouldn't override hscall function, or you may break partial

Re: [Haskell-cafe] [ANNAUNCE] ghcjs-0.1.0 Haskell to Javascript compiler

2010-10-27 Thread Victor Nazarov
On Wed, Oct 27, 2010 at 4:30 PM, Martijn Schrage mart...@oblomov.com wrote: On 21-10-10 01:01, Victor Nazarov wrote: I've been working on this for some month and I think now I'm ready to share the results. Great stuff! I've been looking for something like this for a long time. If you add

Re: [Haskell-cafe] [ANNAUNCE] ghcjs-0.1.0 Haskell to Javascript compiler

2010-10-27 Thread Victor Nazarov
wasn't able to run it in Chrome without dedicated HTTP-server, seems like it is the only way... -- Victor Nazarov ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] [ANNAUNCE] ghcjs-0.1.0 Haskell to Javascript compiler

2010-10-21 Thread Victor Nazarov
On Thu, Oct 21, 2010 at 6:35 AM, Richard O'Keefe o...@cs.otago.ac.nz wrote: On 21/10/2010, at 12:01 PM, Victor Nazarov wrote: I've been working on this for some month and I think now I'm ready to share the results. Given that this is alpha code, what's the performance like? I don't have

[Haskell-cafe] [ANNAUNCE] ghcjs-0.1.0 Haskell to Javascript compiler

2010-10-20 Thread Victor Nazarov
to experiment with it as you wish. Implementation -- Compiler is implemented as [GHC](http://www.haskell.org/ghc/) backend using GHC API. And been tested with GHC 6.12.1. -- Victor Nazarov ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] Suggestions for improvement

2010-10-03 Thread Victor Nazarov
mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Victor Nazarov ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Coding conventions for Haskell?

2010-09-27 Thread Victor Nazarov
= id main = do putStrLn hello putStrLn . concat [ hello , show (f 25 1) ] flip mapM_ [1..100] $ \n - do print n putStrLn hello where hello = Hello I allways use spaces without tabs and allways use camelCase. -- Victor Nazarov

Re: [Haskell-cafe] Announce: lhae

2010-09-03 Thread Victor Nazarov
. -- Victor Nazarov ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Playing with ATs again

2010-08-04 Thread Victor Nazarov
  ... I agree, the fact that this doesn't work is really dumb. I think it is more simple like: class Bijection a b where ... type LeftToRight a = (Bijection a b) = b type RightToLeft b = (Bijection a b) = a -- Victor Nazarov ___ Haskell-Cafe

[Haskell-cafe] Data types a la carte

2010-07-21 Thread Victor Nazarov
a b -- Victor Nazarov ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Why this doesn't type checked

2010-06-27 Thread Victor Nazarov
) In the expression: do { print (sizeof :: Sizeof Word16) } What can I do with this code to make it type-check? -- Victor Nazarov ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Why this doesn't type checked

2010-06-27 Thread Victor Nazarov
On Mon, Jun 28, 2010 at 12:33 AM, Daniel Fischer daniel.is.fisc...@web.de wrote: On Sunday 27 June 2010 21:52:18, Victor Nazarov wrote: I've allways found code like -- maxBound (undefined :: Int) a bit strange Well, that would indeed be a bit strange since maxBound :: (Bounded

Re: [Haskell-cafe] GUI programming

2010-02-08 Thread Victor Nazarov
On Fri, Feb 5, 2010 at 9:54 PM, Mario Blažević mblaze...@stilo.com wrote: Victor Nazarov wrote: Hello, I've been writing some GUI application with Gtk2hs. It's an interpreter for lambda-calculus and combinatory logic, it's GPL and if you interested I can share it with cafe. The problem

Re: [Haskell-cafe] Re: GUI programming

2010-02-03 Thread Victor Nazarov
On Wed, Feb 3, 2010 at 4:11 PM, Heinrich Apfelmus apfel...@quantentunnel.de wrote: Victor Nazarov wrote: data Behaviour a =   forall b. BBind (Behaviour b) (b - Behaviour a)   | BIO (IO a)   | forall obj. GObjectClass obj = BWaitEvent (Event obj) (Behaviour a) instance Monad Behaviour

[Haskell-cafe] GUI programming

2010-02-02 Thread Victor Nazarov
let buttonB label = do liftIO $ set button [buttonLabel := label] waitEvent (onClicked button) buttonB (label ++ *) runBehaviour (buttonB *) set window [containerChild := button] widgetShowAll window mainGUI -- Victor Nazarov {-# LANGUAGE

[Haskell-cafe] diff implementation in haskell

2009-12-06 Thread Victor Nazarov
:: a - a - Difference a patch :: a - Difference a - a prop_diffpatch a b = patch a (diff a b) == b ? If not, where can I start towards the implementation? What's the way to do it more functionally? -- Victor Nazarov ___ Haskell-Cafe mailing list Haskell-Cafe

[Haskell-cafe] Problem with type families

2009-09-21 Thread Victor Nazarov
comb a b = q * a + b addCols q m n (LisMatrix xs) = ListMatrix $ map (\row - modifyNth n (comb (row !! m)) row) where comb a b = q * a + b ... How can I fix this? -- Victor Nazarov ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Problem with type families

2009-09-21 Thread Victor Nazarov
On Tue, Sep 22, 2009 at 1:31 AM, Daniel Fischer daniel.is.fisc...@web.de wrote: Am Montag 21 September 2009 23:15:48 schrieb Victor Nazarov: I've tried to reimplement code presented in the following blog post: http://cdsmith.wordpress.com/2009/09/20/side-computations-via-type-classes

[Haskell-cafe] FastCGI error handling

2009-08-03 Thread Victor Nazarov
what happens main = runFastCGI $ handleErrors test -- This works fine So one variant of main function works, the other allways gives no output. What can be the case? -- Victor Nazarov ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

[Haskell-cafe] Re: FastCGI error handling

2009-08-03 Thread Victor Nazarov
flag. Everything works fine with this flag. -- Victor Nazarov ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Leksah works!

2009-07-23 Thread Victor Nazarov
, utf8-string-0.3.5, xhtml-3000.2.0.1, zlib-0.5.2.0 /home/vir/.ghc/i386-linux-6.10.4/package.conf: Cabal-1.6.0.1, Cabal-1.6.0.3, binary-0.5.0.1, utf8-string-0.3.5 -- Victor Nazarov ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] Slightly off-topic: Lambda calculus

2009-06-21 Thread Victor Nazarov
. If somebody here can provide either a proof or a counter-example, that would be helpful. It seems obvious scince beta reduction never introduces new variales... -- Victor Nazarov ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org

Re: [Haskell-cafe] calling a variable length parameter lambda expression

2009-05-07 Thread Victor Nazarov
is not the Haskell way and should be avoid. -- Victor Nazarov On Wed, May 6, 2009 at 11:41 AM, Nico Rolle nro...@web.de wrote: super nice. best solution for me so far. big thanks. regards 2009/5/6 Victor Nazarov asviraspossi...@gmail.com: On Tue, May 5, 2009 at 8:49 PM, Nico Rolle nro

Re: [Haskell-cafe] calling a variable length parameter lambda expression

2009-05-06 Thread Victor Nazarov
, a] - (x y) (z a) doLam :: Ord a = ([a] - Bool) - [a] - Bool doLam lam params = lam params So, this will work fine: doLam lam1 [1, 2] doLam lam2 [1,2,3,4] -- Victor Nazarov ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org

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

2009-04-22 Thread Victor Nazarov
/lib/cabal/bin into your PATH. -- Victor Nazarov ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] base-4 + gtk2hs-0.10.0 licensing

2009-02-25 Thread Victor Nazarov
I wonder what software licence I can use to release my application. I've developed some education tool with the following dependencies: % ghci Main.hs GHCi, version 6.10.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking

[Haskell-cafe] Help using catch in 6.10

2009-02-20 Thread Victor Nazarov
Hello, cafe. I whant to switch to GHC 6.10 My application compiled fine with 6.8.3, but after switchin to 6.10, I've got errors about usage of catch function: Main.hs:165:14: Ambiguous type variable `e2' in the constraint: `Exception e2' arising from a use of `catch' at

Re: [Haskell-cafe] Re: Datatypes - Haskell

2008-02-10 Thread Victor Nazarov
On Feb 10, 2008 3:40 PM, Mattes Simeon [EMAIL PROTECTED] wrote: Thanks for your help. It was very useful. Though in comparison with C or C++ I can't figure out so clear the syntax. Maybe it has to do with the syntactic Sugar of each Language. I 'll give you a similar example I saw in a book

Re: Re[2]: The programming language market (was Re: [Haskell-cafe] Why functional programming matters

2008-01-27 Thread Victor Nazarov
On Jan 27, 2008 11:49 AM, Bulat Ziganshin [EMAIL PROTECTED] wrote: oh, yes, they are really still study 19th century physics, but not because of great mind, but due to age of university professors. i've studied at Moscow University in 89-91 and department of computer languages still studied

Re: [Haskell-cafe] Re: Displaying steps in my interpreter

2008-01-11 Thread Victor Nazarov
On Jan 10, 2008 8:39 PM, apfelmus [EMAIL PROTECTED] wrote: Victor Nazarov wrote: Yes, there is: you can use a zipper http://en.wikibooks.org/wiki/Haskell/Zippers Here's how: data Branch v = AppL (Term v) | AppR (Term v) | Lamb v type Context

[Haskell-cafe] Displaying steps in my interpreter

2008-01-10 Thread Victor Nazarov
Hello, I have little practice in Haskell. And I look forward for suggestions on how to improve the code. Code is not working: some definitions are missed. The goal of the code is to implement the evaluator for untyped lambda-calculus. The main problem is how to display each step of reduction?

Re: [Haskell-cafe] \_ - not equivalent to const $

2008-01-10 Thread Victor Nazarov
On Jan 11, 2008 2:11 AM, Felipe Lessa [EMAIL PROTECTED] wrote: On Jan 10, 2008 8:54 PM, Luke Palmer [EMAIL PROTECTED] wrote: Can someone explain what the heck is going on here? AFAICT, nothing is wrong. You see, both returned the very same values. [snip] But referential transparency wasn't

Re: [Haskell-cafe] \_ - not equivalent to const $

2008-01-10 Thread Victor Nazarov
On Jan 11, 2008 2:28 AM, Felipe Lessa [EMAIL PROTECTED] wrote: On Jan 10, 2008 9:20 PM, Luke Palmer [EMAIL PROTECTED] wrote: Ahh, it was ghc 6.8.1, without any optimization. If I turn on optimization, the behavior goes away, and they both behave like the const version. That was what I

Re: [Haskell-cafe] Re: distinguish functions from non-functions in a class/instances

2007-12-07 Thread Victor Nazarov
On Dec 7, 2007 4:46 PM, Luke Palmer [EMAIL PROTECTED] wrote: On Dec 7, 2007 6:27 AM, Victor Nazarov [EMAIL PROTECTED] wrote: nary 0 x [] = x nary n f (x:xs) | n 0 = nary (n-1) (f $ read x) xs Sometimes it helps to write type signatures for functions. As in this case, where you'll find

Re: [Haskell-cafe] Re: distinguish functions from non-functions in a class/instances

2007-12-07 Thread Victor Nazarov
On Dec 7, 2007 2:52 PM, [EMAIL PROTECTED] wrote: In fact, that distinction is possible. The following article How to write an instance for not-a-function http://okmij.org/ftp/Haskell/typecast.html#is-function-type specifically describes a method of writing an instance which

Re: [Haskell-cafe] Why not assign a type to unsafePerformIO?

2007-10-03 Thread Victor Nazarov
On 10/4/07, Justin Bailey [EMAIL PROTECTED] wrote: On 10/3/07, Victor Nazarov [EMAIL PROTECTED] wrote: But how would you know that evil dictator uses unsafePerformIO??? You don't. unsafePerformIO can't be taken it away (there are legitimate reasons to strip IO), which is why I wonder

Re: [Haskell-cafe] distghc possible?

2007-09-27 Thread Victor Nazarov
i am a newbie in haskell. i have read about the tool distcc, http://distcc.samba.org/. so i was wondering, does something like this already exist for haskell? would it be possible to implement a similar tool based on ghc for haskell or does this not make sense as a haskell program has to be

[Haskell-cafe] Haskell guards

2007-09-20 Thread Victor Nazarov
I still can't remember how guards are treated in Haskell. Here is the code snippet in question: foo a | a == 1 = 6 foo a | a == 2 = 7 foo a = 8 Would Haskell fall through to the third alternative if a is not equal to 1 or 2. I know that this can be rewritten more sanely, but I just consider