[Haskell-cafe] What is the difference between runhaskell and compile?

Thomas DuBuisson thomas.dubuisson at gmail.com
Fri May 25 05:16:08 CEST 2012


If it is simple then please paste it somewhere.  Perhaps stackoverflow
would be a better medium for this discussion.

-Thomas

On Thu, May 24, 2012 at 8:05 PM, Magicloud Magiclouds
<magicloud.magiclouds at gmail.com> wrote:
> Hi there,
>  The code could not be simpler. Just ldapInit, ldapSimpleBind.
>  I just found that the code works with ghci, too. So to sum up,
> ghci/runhaskell works, ghc not.
>
> On Thu, May 24, 2012 at 8:15 PM, Vincent Ambo <tazjin at googlemail.com> wrote:
>> Can you paste your code somewhere? I'm using the LDAP package at work (for authenticating a Yesod app) and a quick test of the basic LDAP package in GHCi works for me:
>>
>> λ> import LDAP
>> λ> ldap <- ldapInit "10.0.0.12" ldapPort
>> λ> ldapSimpleBind ldap "geva" "**********"
>> λ> let desiredAttr = LDAPAttrList ["name"]
>> λ> let searchDN = Just "OU=Redacted,DC=redacted,DC=com"
>> λ> let searchFilter = Just "sAMAccountName=geva"
>> λ> ldapSearch ldap searchDN LdapScopeSubtree searchFilter desiredAttr False
>> [LDAPEntry {ledn = "CN=Vincent Ambo,OU=Redacted,DC=redacted,DC=com", leattrs = [("name",["Vincent Ambo"])]}]
>>
>> It also works in compiled applications and in source files run with runhaskell.
>>
>> Our directory server runs Active Directory.
>>
>> On May 24, 2012, at 11:36 AM, Magicloud Magiclouds wrote:
>>
>>> Hi,
>>>  I am writing a small program using LDAP hackage. A weird problem occured.
>>>  When the code was run by runhaskell, things were fine, worked as expected.
>>>  But when ghc compiled (no any args), and ran, I got this: LDAP
>>> error: ldapSimpleBind: LDAPException LdapServerDown(-1): Can't contact
>>> LDAP server.
>>>  There is sure no problem with the server.
>>>  So I am confused. I thought the two supposed to be the same.
>>> --
>>> 竹密岂妨流水过
>>> 山高哪阻野云飞
>>>
>>> And for G+, please use magiclouds#gmail.com.
>>>
>>> _______________________________________________
>>> Haskell-Cafe mailing list
>>> Haskell-Cafe at haskell.org
>>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>
>
>
> --
> 竹密岂妨流水过
> 山高哪阻野云飞
>
> And for G+, please use magiclouds#gmail.com.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe



More information about the Haskell-Cafe mailing list