[Haskell-cafe] MonadError vs Control.Exception

2012-05-04 Thread Станислав Черничкин
Hi, guys, I'm interested in best practices in using of each approach.
Personally I like MonadError because it is more explicit and
Control.Exception-s becomes really ugly in complex scenarios.

Here an example to illustrate my idea:
http://hackage.haskell.org/packages/archive/network-conduit/0.4.0/doc/html/src/Data-Conduit-Network.html#bindPort.
All network-conduit functions can raise IOException because of
Socket-related stuff (and actually entire network-conduit is written
to deal with IOException correctry) + Bind-port can raise ErrorCall
(came from error bindPort: addrs is empty). User has to deal with
both, but have no evidence on none of them from type signatures or
documentation. Moreover, ErrorCall in this case can be caused by
IOException (we try to bind only available address, we get IOException
exception, we have no more address to try and raise ErrorCall), and I
really don’t understand, why it should be treated in a different way.

So, I hate exceptions, I blame it, I think exceptions is junk came
from OO-world and horrible languages like C# or even more horrible
like Java, and it should be wiped out from Haskell with fire. But it
is only my humble opinion. Reality shows that Haskell provides
extensive support for exceptions, it included in base libraries and
everyone uses it, but MonadError is modest part of mtl, and don’t even
have “bracket” and other useful functions. That is why I’m really
interested in any your ideas and experience on using these approaches.

Cheers, Stasik.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] HJavaScript: representing build-in global function.

2011-08-27 Thread Станислав Черничкин
Hi Cafe! Does someone know how to represent js build-in global
function (such as parseInt(), parseFloat(), eval()) with HJavaScript?
Perhaps JConst: JCall (JConst parseInt) (JString 123)?

-- 
Sincerely, Stanislav Chernichkin.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Building regex-posix for windows

2010-04-15 Thread Станислав Черничкин
I'm having trouble building regex-posix for Windows under MinGW because 
MinGW does not include regex.h. As far as I know Haskell Platform uses 
MinGW and it includes regex-posix. I'd like to build regex-posix by 
myself, like Haskell Platform does. I would appreciate it if someone 
suggests some resources about building regex-posix and other packages 
for windows. I’m also looking for Haskell Platform developer’s blog or 
something similar, where I can read about porting Haskell on Windows. 
Thanks.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: Happstack 0.4.1

2010-02-11 Thread Станислав Черничкин
I was unable to install happstack-data-0.4.1 on windows with GHC 6.12.1. 
Here the log:


Resolving dependencies...
Configuring happstack-data-0.4.1...
Preprocessing library happstack-data-0.4.1...
Preprocessing executables for happstack-data-0.4.1...
Building happstack-data-0.4.1...

src\Happstack\Data\GOps.hs:54:0:
 warning: no newline at end of file

src\Happstack\Data\SerializeTH.hs:88:0:
 warning: no newline at end of file
[ 1 of 16] Compiling Happstack.Data.GOps ( src\Happstack\Data\GOps.hs, 
dist\buil

d\Happstack\Data\GOps.o )

src\Happstack\Data\Serialize.hs:1:85:
Warning: -XPatternSignatures is deprecated: use 
-XScopedTypeVariables or pra

gma {-# LANGUAGE ScopedTypeVariables #-} instead

src\Happstack\Data\Xml\Base.hs:6:13:
Warning: -XPatternSignatures is deprecated: use 
-XScopedTypeVariables or pra

gma {-# LANGUAGE ScopedTypeVariables #-} instead
[ 2 of 16] Compiling Happstack.Data.Normalize ( 
src\Happstack\Data\Normalize.hs,

 dist\build\Happstack\Data\Normalize.o )
[ 3 of 16] Compiling Happstack.Data.Migrate ( 
src\Happstack\Data\Migrate.hs, dis

t\build\Happstack\Data\Migrate.o )
[ 4 of 16] Compiling Happstack.Data.Default ( 
src\Happstack\Data\Default.hs, dis

t\build\Happstack\Data\Default.o )
[ 5 of 16] Compiling Happstack.Data.DeriveAll ( 
src\Happstack\Data\DeriveAll.hs,

 dist\build\Happstack\Data\DeriveAll.o )
[ 6 of 16] Compiling Happstack.Data.Default.Generic ( 
src\Happstack\Data\Default

\Generic.hs, dist\build\Happstack\Data\Default\Generic.o )
[ 7 of 16] Compiling Happstack.Data.Xml.Base ( 
src\Happstack\Data\Xml\Base.hs, d

ist\build\Happstack\Data\Xml\Base.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.3.0.0 ... linking ... done.
Loading package bytestring-0.9.1.5 ... linking ... done.
Loading package containers-0.3.0.0 ... linking ... done.
Loading package pretty-1.0.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package syb-with-class-0.6.1 ... linking ... done.
Loading package HUnit-1.2.2.1 ... linking ... done.
Loading package syb-0.1.0.2 ... linking ... done.
Loading package base-3.0.3.2 ... linking ... done.
Loading package Win32-2.2.0.1 ... linking ... done.
Loading package old-locale-1.0.0.2 ... linking ... done.
Loading package time-1.1.4 ... linking ... done.
Loading package random-1.0.0.2 ... linking ... done.
Loading package QuickCheck-1.2.0.0 ... linking ... done.
Loading package extensible-exceptions-0.1.1.1 ... linking ... done.
Loading package mtl-1.1.0.2 ... linking ... done.
Loading package old-time-1.0.0.3 ... linking ... done.
Loading package parsec-2.1.0.1 ... linking ... done.
Loading package hsemail-1.3 ... linking ... done.
Loading package network-2.2.1.7 ... linking ... done.
Loading package SMTPClient-1.0.1 ... linking ... done.
Loading package filepath-1.1.0.3 ... linking ... done.
Loading package directory-1.0.1.0 ... linking ... done.
Loading package process-1.0.1.2 ... linking ... done.
Loading package hslogger-1.0.7 ... linking ... done.
Loading package deepseq-1.1.0.0 ... linking ... done.
Loading package parallel-2.2.0.1 ... linking ... done.
Loading package strict-concurrency-0.2.2 ... linking ... done.
Loading package unix-compat-0.1.2.1 ... linking ... done.
Loading package happstack-util-0.4.1 ... linking ... done.
Loading package binary-0.5.0.2 ... linking ... done.
Loading package haskell98 ... linking ... done.
Loading package HaXml-1.13.3 ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
ghc.exe: dist\build\Happstack\Data\Default.o: unknown symbol 
`_sybzmwithzmclassz

m0zi6zi1_DataziGenericsziSYBziWithClassziInstances_constrZMacbsZN_closure'

cabal: Error: some packages failed to install:
happstack-data-0.4.1 failed during the building phase. The exception was:
ExitFailure 1

I can create more detailed log if you need.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe