[Haskell-cafe] Re: Ready for testing: Unicode support for Handle I/O

2009-02-04 Thread Max Vasin
e in Bulat Ziganshin's streams library. -- WBR, Max Vasin. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Timing difference

2008-12-25 Thread Max Vasin
definetly will use a compiled version instead of interpreted). -- WBR, Max Vasin. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: hGetContents and lazyness

2008-09-23 Thread Max Vasin
Micah Cowan <[EMAIL PROTECTED]> writes: > Max Vasin wrote: >> Hello, haskellers! >> >> Suppose we have function (it filters package filenames from apt Packages >> file): >> >>> getPackageList :: FilePath -> IO [FilePath] >>>

[Haskell-cafe] hGetContents and lazyness

2008-09-22 Thread Max Vasin
rop 10) $! filter (startsWith "Filename:") $! lines c with no success. Chaning it to > return $! map (drop 10) $ filter (startsWith "Filename:") $ lines c makes getPackageList function return several (but not all) filenames. What I'm missing? And how can I fix my code?

Re: [Haskell-cafe] FW: Treating command-line arguments as a Haskell expression

2007-12-24 Thread Max Vasin
2007/12/24, Simon Peyton-Jones <[EMAIL PROTECTED]>: > Would someone familiar with the command-line-parsing libraries care to help > Krassimir? AFAIU Krassimir's needs, hs-plugins will help him (function eval). -- WBR, Max Vasin JID:

Re: [Haskell-cafe] Template Haskell newbie questions

2007-09-24 Thread Max Vasin
ped only if $(sel x y) has type (a, b) -> c. -- WBR, Max Vasin JID: [EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] ANNOUNCE: xmonad 0.3

2007-09-06 Thread Max Vasin
ment for explorer), not a window manager. In Windows there is no such thing as window manager (it's functionality is built-in into Windows itself). -- WBR, Max Vasin JID: [EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org ht

Re: [Haskell-cafe] ANNOUNCE: xmonad 0.3

2007-09-05 Thread Max Vasin
er. > If so, would it be possible to integrate this into GTK2HS so it works as > a docking manager inside an application? First of all, gtk is a cross platform toolkit and gtk2hs is just a wrapper. It will be better to implement a docking manager in C to let whole gtk community use it. -- W

Re: [Haskell-cafe] defining mapPairs function

2007-08-29 Thread Max Vasin
u can get a better version by changing > the last line: > > mapPairs f (x:y:zs) = ... - left as an exercise, but no need for head or tail. And you can get less equations if you replace first two equations with mapPairs f x = x and place it after Neil's. -- WBR, Max Vasin JID: [EMAI

[Haskell-cafe] Re: ANN: HSH 1.2.0

2007-03-21 Thread Max Vasin
ll libs from sources. So, do $ apt-get source libghc6-mtl-dev $ cd $ runhaskell Setup.lhs configure $ runhaskell Setup.lhs build $ sudo runhaskell Setup.lhs install Another way is to take ghc6 and all haskell libs from fiesty. -- WBR, Max Vasin. ___

[Haskell-cafe] Re: How to use infinite lists to define the list of all negative integers

2007-02-05 Thread Max Vasin
>>>>> "Bahtijar" == Bahtijar Vogel <[EMAIL PROTECTED]> writes: Bahtijar> Hi, How am I supposed to use infinite lists to define Bahtijar> the list of all negative integers? negs = [-1,-2..] -- WBR, Max Vasin.

[Haskell-cafe] Re: nested maybes

2007-02-04 Thread Max Vasin
> boolFromMaybe Nothing = False import isJust boolFromMaybe = isJust -- WBR, Max Vasin. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: snd and tuples of various sizes...

2007-02-02 Thread Max Vasin
here > ssnd (_:y:_) = return y > ssnd _ = fail "don't got none" > main = do > print $ (ssnd [1, 2, 3] :: Maybe Int) > print $ (ssnd [1] :: Maybe Int) -- WBR, Max Vasin. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Default (or empty) values

2007-01-17 Thread Max Vasin
>>>>> "Pedro" == Pedro Baltazar Vasconcelos <[EMAIL PROTECTED]> writes: Pedro> On Wed, 17 Jan 2007 16:57:54 +0300 Pedro> Max Vasin <[EMAIL PROTECTED]> wrote: > It does not enforce presence of required fields at type level. Also it >> does n

[Haskell-cafe] Re: Default (or empty) values

2007-01-17 Thread Max Vasin
>>>>> "Henning" == Henning Thielemann <[EMAIL PROTECTED]> writes: Henning> On Wed, 17 Jan 2007, Max Vasin wrote: > Hello all! >> >> Let >> >> > data Book = Book { > authors :: [String], > title :: String, >> > ed

[Haskell-cafe] Re: Default (or empty) values

2007-01-17 Thread Max Vasin
>>>>> "Colin" == Colin DeVilbiss <[EMAIL PROTECTED]> writes: Colin> On 1/17/07, Max Vasin <[EMAIL PROTECTED]> wrote: >> Fields of the Book datatype which are not (Maybe a) are >> required to be present. Colin> This doesn't actually

[Haskell-cafe] Re: Default (or empty) values

2007-01-17 Thread Max Vasin
>>>>> "Pedro" == Pedro Baltazar Vasconcelos <[EMAIL PROTECTED]> writes: Pedro> On Wed, 17 Jan 2007 15:58:04 +0300 Pedro> Max Vasin <[EMAIL PROTECTED]> wrote: > Hello all! >> >> Let >> >> > data Book = Book { > au

[Haskell-cafe] Default (or empty) values

2007-01-17 Thread Max Vasin
class Empty e where > empty :: e But still I have to emplement instances by hand. There are a number of approaches to automatically derive instances (TH, generic classes in GHC, drift). What would you recommend using in this case? Or may be it would be better to drop out Empty and

[Haskell-cafe] Re: The Future of MissingH

2006-11-27 Thread Max Vasin
table to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. -- WBR, Max Vasin. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: The Future of MissingH

2006-11-26 Thread Max Vasin
cial code Benjamin> I hate to be nitpicking but GPL is not only compatible Benjamin> with but encourages commerce in general and commercial Benjamin> software in particular. It is incompatible with Benjamin> proprietary software. There's a difference. A small addition: s

[Haskell-cafe] Re: best Linux for GHC?

2006-11-13 Thread Max Vasin
I think Haskell packages from sid can be installed on etch with no harm (or problem). All you need is to configure apt to use both testing and unstable. -- WBR, Max Vasin. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org

[Haskell-cafe] Re: what GUI library should i select?

2006-11-13 Thread Max Vasin
On linux you should use your package manager (whenever possible), not binaries from the site (or compile it yourself). -- WBR, Max Vasin. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: best Linux for GHC?

2006-11-13 Thread Max Vasin
s for Linux. PS: I'm using Debian testing/unstable. -- WBR, Max Vasin ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: StateT and modify

2006-11-08 Thread Max Vasin
s. i am aware of trace, but the potentially messed up Peter> execution order makes it very hard for me to get useful Peter> information out of the resulting trace. besides, IO will Peter> scale to more elaborate logging mechanisms later on... If all you want from IO is logging why

[Haskell-cafe] Re: More documentation: languages written in Haskell

2006-10-29 Thread Max Vasin
d> Haskell, (I think at least a few people on this list have Donald> written one or two themselves ... ;) please add it to the Donald> list. I have no login at haskell.org, so I post here. There is a Curry compiler implemented in Haskell: The Münster Cur

[Haskell-cafe] Re: UTF and Parsec

2006-10-27 Thread Max Vasin
t; utf-8 stuff automatically? What does it mean when I find John> that parsec is picking up "" at the beginning of the All strings in Haskell are unicode - you only have to input them correctly :-) I've used Streams (somewhere at haskell.org) library to read files i

[Haskell-cafe] Re: Haskell compiler from a USB Stick?

2006-10-03 Thread Max Vasin
iler that will run from a USB >> stick? >> >> i'm ôäüùûå sure Jón> Блым? almost %-) Bulat accidently switched keyboard layout to russian :-) -- WBR, Max Vasin. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Getting the latest

2006-09-27 Thread Max Vasin
7;t be updated later. It should be :-) PS: It is better to build a custom package (dh_make will help you). -- WBR, Max Vasin. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Is Haskell a 5GL?

2006-09-25 Thread Max Vasin
believers in language classification by generation? As already mentioned you can write algorithms in Haskell (3GL), embed a DSL in it and write a program in that DSL or in several DSLs (4GL). AFAIK Mathematica is not a logic programming language, thus all its features can be implemented in Haskell

[Haskell-cafe] Re: Is Haskell a 5GL?

2006-09-25 Thread Max Vasin
m in a top-down Ch> style I would say in a "more declarative" style, the "where" is closer to thinking of the program as a set of equations (as opposed to "let"). -- WBR, Max Vasin. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Using of C constants in Haskell sources; Determining compilation environment (Unix vs Windows)

2006-07-11 Thread Max Vasin
cessed with cpp, so if constants are #define'd (and not declared with `const') you can use preprocessor macros to generate Haskell code (yeh, I know it's silly, but why not?). -- WBR, Max Vasin. NP: Nothing playing right now ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Defining show for a function type.

2006-07-11 Thread Max Vasin
cannot show" E.g: data Foo = Bar | Foo (Int -> Int -> Int) instance Show Foo where show Bar = "Bar" show (Foo _) = "Func!" main = do putStrLn $ show Bar putStrLn $ show $ Foo (+) -- WBR, Max Vasin. NP: Nothing playing right now

[Haskell-cafe] Re: how to apply a function which returns IO() to a list?

2006-06-14 Thread Max Vasin
() writeList (x:xs) = do writeHtml x writeList xs -- WBR, Max Vasin. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: calling haskell from C++

2006-05-23 Thread Max Vasin
process to run 'runhaskell file.hs' and redirect its stdout to a pipe. There is also an FFI which allows you to call functions written in Haskell from other languages. In this case your Haskell program must export C-level API to be used from C++. Or, and of ca

[Haskell-cafe] Re: develop new Haskell shell?

2006-05-12 Thread Max Vasin
gt; mv, etc. Has anyone implemented grep, find, etc? Brian> This is also how I would start because it would allow all the Brian> control flow/ ease of use issues to be explored just using GHCi Brian> / Hugs etc before tackling the problem of how to get binaries Brian> to interface w

[Haskell-cafe] Re: Type classes

2006-03-20 Thread Max Vasin
at your Entry type needs to be existentially Stefan> quantified? I want a map of entries (mapping lables to entries). Generally each style can define its own data types for database objects. Converting entries from data BibEntry = { beLabel :: String , beKind :: Strin

[Haskell-cafe] Re: Type classes

2006-03-20 Thread Max Vasin
t,> (Haskell98!): >> class DatabaseEntry e where entryLabel :: e -> String formatEntry >> :: e -> String compareEntries :: e -> e -> Ordering >> >> data Entry a = Entry a No. I don't want that. The database parsing function returns Map.Map String Entry bu

[Haskell-cafe] Type classes

2006-03-20 Thread Max Vasin
; entryLabel (Entry e) = entryLabel e > formatEntry (Entry e) = formatEntry e How can I define compareEntries for this instance? -- WBR, Max Vasin. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Proper way to write this

2005-12-27 Thread Max Vasin
ut this runDaytimeServer :: DaytimeServer -> IO DaytimeServer runDaytimeServer dts = do dts' <- runStreamDaytimeServer dts dts' <- runDgramDaytimeServer dts' return dts' runDaytimeServer dts = runStreamDaytimeServer dts >>= runDgramDaytimeServer Don't

[Haskell-cafe] Re: Constructor constraints

2005-09-20 Thread Max Vasin
mation would be appreciated. Don't export constructors and define functions which will imply your constraints. module Foo (..., Category,... makeCategory1, makeCategory2, ...) -- WBR, Max Vasin. ___ Haskell-C

[Haskell-cafe] Re: Monad transformers

2005-05-08 Thread Max Vasin
On Sun, 8 May 2005 20:29:31 +0200, Tomasz Zielonka <[EMAIL PROTECTED]> said: > On Sun, May 08, 2005 at 10:19:28PM +0400, Max Vasin wrote: >> On Sun, 8 May 2005 18:34:37 +0200, Tomasz Zielonka >> <[EMAIL PROTECTED]> said: >> > On Sun, May 08, 2005 at 07:54:

[Haskell-cafe] Re: Monad transformers

2005-05-08 Thread Max Vasin
On Sun, 8 May 2005 18:34:37 +0200, Tomasz Zielonka <[EMAIL PROTECTED]> said: > On Sun, May 08, 2005 at 07:54:43PM +0400, Max Vasin wrote: >> Hello! >> >> Suppose we have functions >> >> f :: ReaderT env monad1 rtype g :: Reader env rtype >> >&g

[Haskell-cafe] Monad transformers

2005-05-08 Thread Max Vasin
tly pass it). Is there another way to get things done? -- WBR, Max Vasin. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Specify array or list size?

2005-05-07 Thread Max Vasin
Daniel Carrera <[EMAIL PROTECTED]> writes: > Max Vasin wrote: > >> But why do you need that? Where do need to make an assumption about the size >> of the list? > > I'm implementing the RC4 algorithm, which requires a state array with > 256 elements cont

[Haskell-cafe] Re: Specify array or list size?

2005-05-07 Thread Max Vasin
I'd love to have Haskell make sure that the array > I build is the correct size. In short: in type declarations you can't. But why do you need that? Where do need to make an assumption about the size of the list? -- WBR, Max Vasin. __

[Haskell-cafe] Re: Type classes and definite types

2005-05-06 Thread Max Vasin
lue stmt "Code" return (toSqlValue i) -- etc for all SqlType data constructors putStrLn (unwords [show id, codestr]) At least it compiles. But it's ugly :-( -- WBR, Max Vasin. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Type classes and definite types

2005-05-05 Thread Max Vasin
no operations in > the SqlBind class, it's just a marker as near as I can tell. As of HSQL 1.4 this class has method toSqlValue :: a -> String which probably can help you (I really don't know). Some RTFSing shows that in most cases toSqlVal