Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: Alfred Programs in Haskell (Kim-Ee Yeoh)
2. GHC 7.8.4 source build fails on OSX... (emacstheviking)
3. Re: Alfred Programs in Haskell (Richard Guay)
4. Re: GHC 7.8.4 source build fails on OSX... (emacstheviking)
----------------------------------------------------------------------
Message: 1
Date: Wed, 4 Mar 2015 19:10:49 +0700
From: Kim-Ee Yeoh <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Alfred Programs in Haskell
Message-ID:
<CAPY+ZdS08TtCqpnD8Q9oC6x=iPYUAT=4xxmn77px_gf59wd...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Wed, Mar 4, 2015 at 12:38 PM, Richard Guay <[email protected]> wrote:
> fExist <- doesFileExist $ h ++ cacheDirBasic ++ getBundleID ++ "/" ++
> fileName
> if fExist
> then do
> contents <- readFile $ h ++ cacheDirBasic ++ getBundleID ++ "/" ++
> fileName
>
First of all, let's refactor that into a let binding, e.g.
let pathName = h ++ cacheDirBasic ++ getBundleID ++ "/" ++ fileName
fExist <- doesFileExist pathName
if fExist then readFile pathName else return ""
The advantage of keeping DRY here should be obvious. Defining the same
thing in 2 places can lead to both getting out of lockstep.
Now as for debugging the actual problem, have you tried the REPL? That is,
launch ghci, load the appropriate libraries, and see what happens when you
enter
doesFileExist "/home/me/myfile"
and similarly for readFile. That way you'd rule things out like a file
permissions problem, etc.
-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150304/5d3b6fec/attachment-0001.html>
------------------------------
Message: 2
Date: Wed, 4 Mar 2015 12:51:43 +0000
From: emacstheviking <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] GHC 7.8.4 source build fails on OSX...
Message-ID:
<CAEiEuU+QD=rq5ovguzv8yvkjsn7slwx-b3p6wruva9h1ntr...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
ld: couldn't dlopen() /usr/lib/libdtrace.dylib:
dlopen(/usr/lib/libdtrace.dylib, 1): Symbol not found: _CGLGetCurrentContext
Referenced from:
/System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
Expected in: /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
in /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo for
architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
make[1]: *** [rts/dist/build/libHSrts-ghc7.8.4.dylib] Error 1
make: *** [all] Error 2
iMac:ghc-7.8.4 vosabristol$
Perhaps I need to tweak the configure parameters and try again...
stackoverflow has this page:
http://stackoverflow.com/questions/19480099/compiling-macos-application-with-cgl
There is no CGL framework in OS X (CGL is included in the OpenGL framework,
you need only #include OpenGL/OpenGL.h), and you do not use -lXXX to link
against a framework either. Now, depending on how your Makefile is
structured, you may also have a property known as LD_FLAGS for a separate
linking stage - you *also* need to include -framework OpenGL there. This
directive does *both*, include path resolution and linker path resolution
for frameworks. ? Andon M. Coleman
<http://stackoverflow.com/users/2423205/andon-m-coleman> Oct 20 '13 at 19:36
<http://stackoverflow.com/questions/19480099/compiling-macos-application-with-cgl#comment28894036_19480099>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150304/3a766996/attachment-0001.html>
------------------------------
Message: 3
Date: Wed, 04 Mar 2015 21:01:36 +0700
From: Richard Guay <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Alfred Programs in Haskell
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
It's not a file permission problem because it works great when the file
exists. But, when the file doesn't exist, it still tries to read the
file. It acts like the file is there when it isn't. In ghci, it returns
the true boolean when the file is there and a false when it isn't. But,
in the program, it is always executing the readFile.
Kim-Ee Yeoh wrote:
>
>
> On Wed, Mar 4, 2015 at 12:38 PM, Richard Guay <[email protected]
> <mailto:[email protected]>> wrote:
>
> fExist <- doesFileExist $ h ++ cacheDirBasic ++ getBundleID ++
> "/" ++ fileName
> if fExist
> then do
> contents <- readFile $ h ++ cacheDirBasic ++ getBundleID
> ++ "/" ++ fileName
>
>
> First of all, let's refactor that into a let binding, e.g.
>
> let pathName = h ++ cacheDirBasic ++ getBundleID ++ "/" ++ fileName
> fExist <- doesFileExist pathName
> if fExist then readFile pathName else return ""
>
> The advantage of keeping DRY here should be obvious. Defining the same
> thing in 2 places can lead to both getting out of lockstep.
>
> Now as for debugging the actual problem, have you tried the REPL? That
> is, launch ghci, load the appropriate libraries, and see what happens
> when you enter
>
> doesFileExist "/home/me/myfile"
>
> and similarly for readFile. That way you'd rule things out like a file
> permissions problem, etc.
>
>
> -- Kim-Ee
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150304/66c9b2cf/attachment-0001.html>
------------------------------
Message: 4
Date: Wed, 4 Mar 2015 14:05:24 +0000
From: emacstheviking <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] GHC 7.8.4 source build fails on
OSX...
Message-ID:
<caeieuujld66nnhbumreosmptwdls1+tshpsjj7wu4zxtcag...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
tried adding:
LIBS="-framework OpenGL" ./configure
same result.... bummer.
On 4 March 2015 at 12:51, emacstheviking <[email protected]> wrote:
>
> ld: couldn't dlopen() /usr/lib/libdtrace.dylib:
> dlopen(/usr/lib/libdtrace.dylib, 1): Symbol not found: _CGLGetCurrentContext
> Referenced from:
> /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
> Expected in:
> /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
> in /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
> for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
> make[1]: *** [rts/dist/build/libHSrts-ghc7.8.4.dylib] Error 1
> make: *** [all] Error 2
> iMac:ghc-7.8.4 vosabristol$
>
> Perhaps I need to tweak the configure parameters and try again...
> stackoverflow has this page:
>
> http://stackoverflow.com/questions/19480099/compiling-macos-application-with-cgl
>
> There is no CGL framework in OS X (CGL is included in the OpenGL
> framework, you need only #include OpenGL/OpenGL.h), and you do not use
> -lXXX to link against a framework either. Now, depending on how your
> Makefile is structured, you may also have a property known as LD_FLAGS for
> a separate linking stage - you *also* need to include -framework OpenGL there.
> This directive does *both*, include path resolution and linker path
> resolution for frameworks. ? Andon M. Coleman
> <http://stackoverflow.com/users/2423205/andon-m-coleman> Oct 20 '13 at
> 19:36
> <http://stackoverflow.com/questions/19480099/compiling-macos-application-with-cgl#comment28894036_19480099>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150304/b380351d/attachment.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 81, Issue 21
*****************************************