Re: [Haskell-cafe] ANN: data-fix-cse -- Common subexpression elimination for EDSLs

2013-02-23 Thread Anton Kholomiov
I don't know how to express it. You need to have some dynamic representation since dag is a container of `(Int, f Int)`. I've tried to go along this road type Exp a = Fix (E a) data E c :: * -> * where Lit :: Show a => a -> E a c Op :: Op a -> E a c App :: Phantom (a -> b) c -> Phantom a c

[Haskell-cafe] Need urgent help with Network.tls

2013-02-23 Thread C K Kashyap
Hi, I am trying to use Haskell to download email/attachments from gmail. For which I am exploring Network.TLS. I got this sample from the net that connects to gmail smtp and works just fine - http://hpaste.org/82890 However, when I modify it a bit to try to connect to imap, it simply does not wor

Re: [Haskell-cafe] Need urgent help with Network.tls

2013-02-23 Thread satvik chauhan
You can use HaskellNet or imapget directly or look into their source code for connecting to imap manually. -Satvik On Sat, Feb 23, 2013 at 8:58 PM, C K Kashyap wrote: > Hi, > > I am trying to use Haskel

Re: [Haskell-cafe] Type checking the content of a string

2013-02-23 Thread Corentin Dupont
Up on that, anybody already tried to load an haskell interpreter in a QuasiQuoter? On Sat, Feb 23, 2013 at 12:03 AM, Corentin Dupont wrote: > I'm trying to load my interpreter in the Q monad: > > cr :: QuasiQuoter > cr = QuasiQuoter { quoteExp = quoteRuleFunc} > > quoteRuleFunc :: String -> Q TH

Re: [Haskell-cafe] Need urgent help with Network.tls

2013-02-23 Thread C K Kashyap
The reason I want to use TLS is that I'd want to pack the whole thing in a DLL and give it off to a friend for use. What I am really looking for is a small sample code that demonstrates how TLS package can be used to connect to a webserver or imapserver. Regards, Kashyap On Sat, Feb 23, 2013 at

Re: [Haskell-cafe] Type checking the content of a string

2013-02-23 Thread Brent Yorgey
On Fri, Feb 22, 2013 at 06:44:06PM +0100, Corentin Dupont wrote: > Hi all, > I have a program able to read another program as a string, and interpret it > (using Hint). > I'd like to make unit tests, so I have a file "Test.hs" containing a serie > of test programs as strings. > However, how could I

Re: [Haskell-cafe] Need urgent help with Network.tls

2013-02-23 Thread Brandon Allbery
On Sat, Feb 23, 2013 at 1:58 PM, C K Kashyap wrote: > What I am really looking for is a small sample code that demonstrates how > TLS package can be used to connect to a webserver or imapserver. > TLS isn't actually SSL, despite SSL getting blessed as "TLS 0.9". Various attempts at TLS-enabled w

Re: [Haskell-cafe] Need urgent help with Network.tls

2013-02-23 Thread Vincent Hanquez
On 02/23/2013 06:58 PM, C K Kashyap wrote: The reason I want to use TLS is that I'd want to pack the whole thing in a DLL and give it off to a friend for use. What I am really looking for is a small sample code that demonstrates how TLS package can be used to connect to a webserver or imapserver

Re: [Haskell-cafe] Type checking the content of a string

2013-02-23 Thread Corentin Dupont
Finally, I solved the problem using typeOf instead of interpret: cr :: QuasiQuoter cr = QuasiQuoter { quoteExp = quoteRuleFunc} quoteRuleFunc :: String -> Q TH.Exp quoteRuleFunc s = do res <- runIO $ runInterpreter $ do setImports ["Prelude", "Language.Nomyx.Expression"] typeOf s

Re: [Haskell-cafe] Need urgent help with Network.tls

2013-02-23 Thread Jason Dusek
2013/2/23 C K Kashyap : > The reason I want to use TLS is that I'd want to pack the whole thing in a > DLL and give it off to a friend for use. Why does this requirement compel you to forego the imapget or HaskellNet packages? -- Jason Dusek pgp // solidsnack // C1EBC57DC55144F35460C8DF1FD4C6C1FE

Re: [Haskell-cafe] Need urgent help with Network.tls

2013-02-23 Thread Vincent Hanquez
On 02/23/2013 09:05 PM, Brandon Allbery wrote: On Sat, Feb 23, 2013 at 1:58 PM, C K Kashyap wrote: What I am really looking for is a small sample code that demonstrates how TLS package can be used to connect to a webserver or imapserver. TLS isn't actually SSL, despite SSL getting blessed as

Re: [Haskell-cafe] Need urgent help with Network.tls

2013-02-23 Thread Vincent Hanquez
On 02/23/2013 03:28 PM, C K Kashyap wrote: Hi, I am trying to use Haskell to download email/attachments from gmail. For which I am exploring Network.TLS. I got this sample from the net that connects to gmail smtp and works just fine - http://hpaste.org/82890 Your example look odd, Typically yo

[Haskell-cafe] cabal install ghc-mod installs 3 years old version

2013-02-23 Thread Niklas Hambüchen
Hi, I just did cabal update and cabal install ghc-mod, and for some reason it tries to install version 0.3.0 from 3 years ago: " cabal install ghc-mod -v Reading available packages... Choosing modular solver. Resolving dependencies... Ready to install ghc-mod-0.3.0 Downloading ghc-mod-0.3.0... "

Re: [Haskell-cafe] Need urgent help with Network.tls

2013-02-23 Thread C K Kashyap
What I am looking to achieve is - create a DLL that would do the complete gmail thing that could be linked to a standard C program (on windows) and could be used to download emails from gmail. What I gathered from HsOpenSSL (which is required for HaskellNet) depends on some native ssl dll That

Re: [Haskell-cafe] Need urgent help with Network.tls

2013-02-23 Thread C K Kashyap
Thank you so much Vincent, I think this is what I need ... I tried to use it to connect to a local web server running in 443 - http://hpaste.org/82943 however, I get the following error - ssl_client.hs: connect: failed (Connection refused (WSAECONNREFUSED)) Am I missing something? Regards, Kash

Re: [Haskell-cafe] Need urgent help with Network.tls

2013-02-23 Thread C K Kashyap
Okay ... looks like connection is exactly what I want The examples work just fine on Linux .. however, on Windows, I continue to get the WSACONNECTIONREFUSED eror. Even adding a "withSocketsDo" does not seem to help. Regards, Kashyap On Sun, Feb 24, 2013 at 8:58 AM, C K Kashyap wrote: >

Re: [Haskell-cafe] Need urgent help with Network.tls

2013-02-23 Thread C K Kashyap
Okay ... now magically, I stopped seeing the "WSACONNECTIONREFUSED" error!!! .. Regards, Kashyap On Sun, Feb 24, 2013 at 10:03 AM, C K Kashyap wrote: > Okay ... looks like connection is exactly what I want The examples > work just fine on Linux .. however, on Windows, I continue to get th

[Haskell-cafe] Fixing undeduceable instance ==> overlapping instance

2013-02-23 Thread Michael Orlitzky
I'm trying to write a determinant function that works on matrices parameterized by their dimensions (Peano naturals). If I declare the following, -- Define a class so that we get a different determinant function -- on the base/recursive cases. class (Eq a, Ring.C a) => Determined m a where

Re: [Haskell-cafe] Fixing undeduceable instance ==> overlapping instance

2013-02-23 Thread Karl Voelker
On Sat, Feb 23, 2013 at 10:28 PM, Michael Orlitzky wrote: > -- Recursive case, (n+2) x (n+2) matrices. > instance (Eq a, Ring.C a, Arity n) > => Determined (Mat (S (S n)) (S (S n))) a where > determinant m = > ... > -- Recursive algorithm, the i,jth minor has dimension >

Re: [Haskell-cafe] cabal install ghc-mod installs 3 years old version

2013-02-23 Thread Ivan Lazar Miljenovic
On 24 February 2013 12:38, Niklas Hambüchen wrote: > Hi, > > I just did cabal update and cabal install ghc-mod, and for some reason > it tries to install version 0.3.0 from 3 years ago: > > " > cabal install ghc-mod -v > Reading available packages... > Choosing modular solver. > Resolving dependen

Re: [Haskell-cafe] Fixing undeduceable instance ==> overlapping instance

2013-02-23 Thread Michael Orlitzky
On 02/24/2013 02:14 AM, Karl Voelker wrote: > On Sat, Feb 23, 2013 at 10:28 PM, Michael Orlitzky > wrote: > > -- Recursive case, (n+2) x (n+2) matrices. > instance (Eq a, Ring.C a, Arity n) > => Determined (Mat (S (S n)) (S (S n))) a where >