https://wiki.haskell.org/api.php?action=feedcontributions&user=DanielDeKok&feedformat=atomHaskellWiki - User contributions [en]2019-11-12T17:19:43ZUser contributionsMediaWiki 1.27.4https://wiki.haskell.org/index.php?title=Continuation&diff=45223Continuation2012-04-12T06:29:27Z<p>DanielDeKok: Fix a 404.</p>
<hr />
<div>__TOC__<br />
<br />
== General or introductory materials ==<br />
<br />
=== Powerful metaphors, images ===<br />
<br />
Here is a collection of short descriptions, analogies or metaphors, that illustrate this difficult concept, or an aspect of it.<br />
<br />
==== Imperative metaphors ====<br />
<br />
* In computing, a continuation is a representation of the execution state of a program (for example, the call stack) at a certain point in time (Wikipedia's [http://en.wikipedia.org/wiki/Continuation Continuation]).<br />
* At its heart, <code>call/cc</code> is something like the <code>goto</code> instruction (or rather, like a label for a <code>goto</code> instruction); but a Grand High Exalted <code>goto</code> instruction... The point about <code>call/cc</code> is that it is not a ''static'' (lexical) <code>goto</code> instruction but a ''dynamic'' one (David Madore's [http://www.madore.org/~david/computers/callcc.html#sec_intro A page about <code>call/cc</code>])<br />
<br />
==== Functional metaphors ====<br />
<br />
* Continuations represent the future of a computation, as a function from an intermediate result to the final result ([http://www.haskell.org/haskellwiki/All_About_Monads#The_Continuation_monad] section in Jeff Newbern's All About Monads)<br />
* The idea behind CPS is to pass around as a function argument what to do next ([http://darcs.haskell.org/yaht/yaht.pdf Yet Another Haskell Tutorial] written by Hal Daume III, 4.6 Continuation Passing Style, pp 53-56). [http://en.wikibooks.org/wiki/Haskell/YAHT/Type_basics#Continuation_Passing_Style It can be read also in wikified format].<br />
* Rather than return the result of a function, pass one or more [[Higher order function | Higher Order Functions]] to determine what to do with the result. Yes, direct sum like things (or in generally, case analysis, managing cases, alternatives) can be implemented in CPS by passing ''more'' continuations.<br />
<br />
=== External links ===<br />
<br />
* [http://en.wikibooks.org/wiki/Haskell/Continuation_passing_style The appropriate section of Haskell: Functional Programming with Types].<br />
* Wikipedia's [http://en.wikipedia.org/wiki/Continuation Continuation] is a surprisingly good introductory material on this topic. See also [http://en.wikipedia.org/wiki/Continuation-passing_style Continuation-passing style].<br />
* [http://darcs.haskell.org/yaht/yaht.pdf Yet Another Haskell Tutorial] written by Hal Daume III contains a section on continuation passing style (4.6 Continuation Passing Style, pp 53-56). [http://en.wikibooks.org/wiki/Haskell/YAHT/Type_basics#Continuation_Passing_Style It can be read also in wikified format], thanks to Eric Kow.<br />
* David Madore's [http://www.madore.org/~david/computers/callcc.html A page about <code>call/cc</code>] describes the concept, and his [http://www.madore.org/~david/programs/unlambda/ The Unlambda Programming Language] page shows how he implemented this construct in an esoteric functional programming language.<br />
* [http://www.defmacro.org/ramblings/fp.html#part_9 Continuations] section of article [http://www.defmacro.org/ramblings/fp.html Functional Programming For The Rest of Us], an introductory material to functional programming.<br />
* [http://okmij.org/ftp/Computation/Continuations.html Continuations and delimited control]<br />
<br />
== Examples ==<br />
<br />
=== Citing haskellized Scheme examples from Wikipedia ===<br />
<br />
Quoting the Scheme examples (with their explanatory texts) from Wikipedia's [http://en.wikipedia.org/wiki/Continuation-passing_style#Examples Continuation-passing style] article, but Scheme examples are translated to Haskell, and some straightforward modifications are made to the explanations (e.g. replacing word ''Scheme'' with ''Haskell'', or using abbreviated name <hask>fac</hask> instead of <code>factorial</code>).<br />
<br />
In the Haskell programming language, the simplest of direct-style functions is the identity function: <br />
<br />
<haskell><br />
id :: a -> a<br />
id a = a<br />
</haskell><br />
<br />
which in CPS becomes:<br />
<br />
<haskell><br />
idCPS :: a -> (a -> r) -> r<br />
idCPS a ret = ret a<br />
</haskell><br />
where <hask>ret</hask> is the continuation argument (often also called <hask>k</hask>). A further comparison of direct and CPS style is below.<br />
{|<br />
!<center>Direct style</center>!!<center>Continuation passing style</center><br />
|-<br />
|<br />
<haskell><br />
mysqrt :: Floating a => a -> a<br />
mysqrt a = sqrt a<br />
print (mysqrt 4) :: IO ()<br />
</haskell><br />
||<br />
<haskell><br />
mysqrtCPS :: a -> (a -> r) -> r<br />
mysqrtCPS a k = k (sqrt a)<br />
mysqrtCPS 4 print :: IO ()<br />
</haskell><br />
|-<br />
|<br />
<haskell><br />
mysqrt 4 + 2 :: Floating a => a<br />
</haskell><br />
||<br />
<haskell><br />
mysqrtCPS 4 (+ 2) :: Floating a => a<br />
</haskell><br />
|-<br />
|<br />
<haskell><br />
fac :: Integral a => a -> a<br />
fac 0 = 1<br />
fac n'@(n + 1) = n' * fac n<br />
fac 4 + 2 :: Integral a => a<br />
</haskell><br />
||<br />
<haskell><br />
facCPS :: a -> (a -> r) -> r<br />
facCPS 0 k = k 1<br />
facCPS n'@(n + 1) k = facCPS n $ \ret -> k (n' * ret)<br />
facCPS 4 (+ 2) :: Integral a => a<br />
</haskell><br />
|}<br />
<br />
The translations shown above show that CPS is a global transformation; the direct-style factorial, <hask>fac</hask> takes, as might be expected, a single argument. The CPS factorial, <hask>facCPS</hask> takes two: the argument and a continuation. Any function calling a CPS-ed function must either provide a new continuation or pass its own; any calls from a CPS-ed function to a non-CPS function will use implicit continuations. Thus, to ensure the total absence of a function stack, the entire program must be in CPS.<br />
<br />
As an exception, <hask>mysqrt</hask> calls <hask>sqrt</hask> without a continuation &mdash; here <hask>sqrt</hask> is considered a primitive [http://en.wikipedia.org/wiki/Operator_%28programming%29 operator]; that is, it is assumed that <hask>sqrt</hask> will compute its result in finite time and without abusing the stack. Operations considered primitive for CPS tend to be arithmetic, constructors, accessors, or mutators; any [http://en.wikipedia.org/wiki/Big_O_notation O(1) operation] will be considered primitive.<br />
<br />
The quotation ends here.<br />
<br />
=== Intermediate structures ===<br />
<br />
The function <hask>Foreign.C.String.withCString</hask> converts a Haskell string to a C string.<br />
But it does not provide it for external use but restricts the use of the C string to a sub-procedure,<br />
because it will cleanup the C string after its use.<br />
It has signature <hask>withCString :: String -> (CString -> IO a) -> IO a</hask>.<br />
This looks like continuation and the functions from continuation monad can be used,<br />
e.g. for allocation of a whole array of pointers:<br />
<haskell><br />
multiCont :: [(r -> a) -> a] -> ([r] -> a) -> a<br />
multiCont xs = runCont (mapM Cont xs)<br />
<br />
withCStringArray0 :: [String] -> (Ptr CString -> IO a) -> IO a<br />
withCStringArray0 strings act =<br />
multiCont<br />
(map withCString strings)<br />
(\rs -> withArray0 nullPtr rs act)<br />
</haskell><br />
However, the right associativity of <hask>mapM</hask> leads to inefficiencies here.<br />
<br />
See:<br />
* Cale Gibbard in Haskell-Cafe on [http://www.haskell.org/pipermail/haskell-cafe/2008-February/038963.html A handy little consequence of the Cont monad]<br />
<br />
=== More general examples ===<br />
<br />
Maybe it is confusing, that<br />
* the type of the (non-continuation) argument of the discussed functions (<hask>idCPS</hask>, <hask>mysqrtCPS</hask>, <hask>facCPS</hask>)<br />
* and the type of the argument of the continuations<br />
coincide in the above examples. It is not a necessity (it does not belong to the essence of the continuation concept), so I try to figure out an example which avoids this confusing coincidence:<br />
<haskell><br />
newSentence :: Char -> Bool<br />
newSentence = flip elem ".?!"<br />
<br />
newSentenceCPS :: Char -> (Bool -> r) -> r<br />
newSentenceCPS c k = k (elem c ".?!")<br />
</haskell><br />
but this is a rather uninteresting example. Let us see another one that uses at least recursion:<br />
<haskell><br />
mylength :: [a] -> Integer<br />
mylength [] = 0<br />
mylength (_ : as) = succ (mylength as)<br />
<br />
mylengthCPS :: [a] -> (Integer -> r) -> r<br />
mylengthCPS [] k = k 0<br />
mylengthCPS (_ : as) k = mylengthCPS as (k . succ)<br />
<br />
test8 :: Integer<br />
test8 = mylengthCPS [1..2006] id<br />
<br />
test9 :: IO ()<br />
test9 = mylengthCPS [1..2006] print<br />
</haskell><br />
<br />
You can download the Haskell source code (the original examples plus the new ones): [[Media:Continuation.hs|Continuation.hs]].<br />
<br />
== Continuation monad ==<br />
<br />
* Jeff Newbern's [http://www.haskell.org/haskellwiki/All_About_Monads All About Monads] contains a [http://www.haskell.org/haskellwiki/All_About_Monads#The_Continuation_monad section] on it.<br />
* [http://hackage.haskell.org/packages/archive/mtl/latest/doc/html/Control-Monad-Cont.html Control.Monad.Cont] is contained by Haskell Hierarchical Libraries.<br />
<br />
== Delimited continuation ==<br />
<br />
* [[Library/CC-delcont]]<br />
* [http://okmij.org/ftp/Computation/Continuations.html#zipper Generic Zipper and its applications], writing that "[[Zipper]] can be viewed as a [[Library/CC-delcont|delimited continuation]] reified as a data structure" (links added).<br />
<br />
== Linguistics ==<br />
<br />
Chris Barker: [http://www.cs.bham.ac.uk/~hxt/cw04/barker.pdf Continuations in Natural Language]<br />
<br />
== Applications ==<br />
<br />
;[http://okmij.org/ftp/Computation/Continuations.html#zipper-fs ZipperFS] <br />
:Oleg Kiselyov's [[zipper]]-based [[Libraries and tools/Operating system|file server/OS]] where threading and exceptions are all realized via [[Library/CC-delcont|delimited continuation]]s.<br />
<br />
[[Category:Idioms]]<br />
[[Category:Glossary]]</div>DanielDeKokhttps://wiki.haskell.org/index.php?title=Applications_and_libraries/Linguistics&diff=38361Applications and libraries/Linguistics2011-01-25T15:43:25Z<p>DanielDeKok: /* Portals and other huge resorces */</p>
<hr />
<div>__TOC__<br />
<br />
== Portals and other huge resorces ==<br />
<br />
Peter Ljunglöf's many [http://www.ling.gu.se/~peb/pubs.html publications] on natural language processing, parsing, formal semantics. Many of them uses Haskell, and there are [http://www.ling.gu.se/~peb/software.html downloadable] Haskell sources too.<br />
<br />
[http://homepages.cwi.nl/~jve/index.html Jan van Eijck's page] contains a huge amount of materials on logic and language:<br />
* computational linguistics<br />
* logics (e.g. dynamic epistemic modelling)<br />
<br />
The [http://projects.haskell.org/nlp Haskell NLP projects] provides a mailing list for Haskellers doing NLP work, as well as a community wiki and darcs repository. Come join us!<br />
<br />
[http://nlpwp.org/ Natural Language Processing for The Working Programmer] is a book that provides an introduction to Haskell and NLP.<br />
<br />
There are many Haskell resources, too.<br />
<br />
== Tools and libraries ==<br />
<br />
* [http://cypher.monrai.com Cypher] is one of the first software program available which generates the metadata representation of natural language input. Cypher produces RDF graph and SeRQL query representations of sentences, clauses, phrases and questions. The Cypher framework provides a set of robust definition languages, which can be used to extend and create grammars and lexicons. Cypher programming is fun to learn and easy to use, and the specifications are designed to allow a novice to quickly and easily build transcoders for processing highly complex sentences and phrases of any natural language, and to cover any vocabulary<br />
* [http://trac.loria.fr/~geni GenI] is a surface realiser for Tree Adjoining Grammars. Surface realisation can be seen as the last stage in a natural language generation pipeline. GenI in particular takes an FB-LTAG grammar and an input semantics (a conjunction of first order terms), and produces the set of sentences associated to the input semantics by the grammar. See also [http://www.loria.fr/~kow/ Eric Kow]'s recent publications on it.<br />
* [http://grammaticalframework.org/ Grammatical Framework] (GF) is a compiler and grammatical programming environment written entirely in Haskell, with an interactive interpreter and two GUI interfaces, one written in Fudgets and another written in Java. GF grammars are written in a subset of Haskell and compile into an internal GF format that may be used as embedded parsers in Haskell, parsers in Java (with an embedded Java interpreter gfc2java.jar) and subsequently converted to applets ([http://www.cs.chalmers.se/~markus/gramlets/ Gramlets]). (GF-Haskell to Java translation is performed through an Open Agent Architecture--the original .NET, see [http://www.cs.chalmers.se/~bringert/gf/gf-oaa.html GF OAA].) The GF grammatical formalism handles linguistic entities (morphemes, etc.) using type theory: an approach especially suited to machine translation of controlled natural languages. The [http://www.cs.chalmers.se/~aarne/GF/lib/resource-1.0/doc/index.html Grammar Resource Library], a set of basic grammars for Danish, English, Finnish, French, German, Italian, Norwegian, Russian, Spanish and Swedish, is available as a separate download. GF has been used to translate a fragment of C code to JVM (see [http://www.cs.chalmers.se/~aarne/GF/doc/gfcc.pdf GFCC (PDF document)]).<br />
* [http://www.cs.chalmers.se/~markus/FM/index.html Functional Morphology] - a toolkit for morphology development. Has been used for Swedish, Spanish, Urdu and more.<br />
* [http://www.cs.utah.edu/~hal/HWordNet/index.html HWordNet] - A Haskell interface to WordNet by Hal Daumé III.<br />
* '''Saxophone''' is a fun translator from German to the Saxon dialect. It is part of the [https://sourceforge.net/projects/parallelweb ParallelWeb] project which aims at translating Web pages including all of their links.<br />
<br />
== Natural language processing and combinatory logic ==<br />
<br />
[[Combinatory logic]] contributed to develop powerful theories in linguistics..<br />
<br />
=== Applicative universal grammar ===<br />
<br />
Now it has got [[/Applicative universal grammar|its own HaskellWiki page]].<br />
<br />
=== Categorial grammar ===<br />
<br />
A general summary of modern semantic theories developed in the century<br />
is provided by [http://citeseer.ist.psu.edu/blackburn97logical.html Logical Aspects of Computational Linguistics: an introduction].<br />
<br />
[http://www-unix.oit.umass.edu/~gmhwww/ Gary Hardegree]'s portal-rich page provides a lot of materials on logic and linguistics, among them<br />
* [http://www-unix.oit.umass.edu/~gmhwww/scholar.htm The Axiomatic Theory of Truth] grasping concepts like truth, quotations, paradoxes, liar's paradox<br />
* [http://www-unix.oit.umass.edu/~gmhwww/scholar.htm Courses] ranging from the introductory level to developed topics, e.g. [http://www-unix.oit.umass.edu/~gmhwww/511/pdf/a3.pdf Basic Categorial Grammar].<br />
<br />
[http://groups.inf.ed.ac.uk/ccg/ The Combinatory Categorial Grammar Site] contains links, papers (both introductory and developed) and software ([http://opennlp.sourceforge.net/ OpenNLP] open source projects, related to natural language processing, and [http://openccg.sourceforge.net/ OpenCCG])<br />
<br />
On natural languages relating to combinatory logic, see also<br />
* Mark Steedman's [http://citeseer.ist.psu.edu/steedman97does.html Does Grammar Make Use of Bound Variables?]<br />
* Mark Hepple: [http://citeseer.ist.psu.edu/hepple90grammar.html The Grammar and Processing of Order and Dependency: a Categorial Approach]<br />
<br />
=== Type-Logical Grammar ===<br />
<br />
Matteo Capelletti's [http://www.let.uu.nl/users/Matteo.Capelletti/personal/Home.html home page] contains a parser based on the Non-associative Lambek calculus. It supports hypothetical reasoning and Montague style semantics. <br />
<br />
=== Tree Adjoining Grammar ===<br />
<br />
* See [http://trac.loria.fr/~geni GenI], mentioned above.<br />
<br />
== Game theoretic semantics ==<br />
<br />
Game theoretic semantics presents an interesting concept of ''truth'' -- in another way than that of Tarski.<br />
Its connections to computer science and computer languages is described in Wikipedia's [http://en.wikipedia.org/wiki/Game_semantics Game semantics] article. Merlijn Sevenster's [http://staff.science.uva.nl/~peter/teaching/merlijns20041129.pdf Game theoretical semantics and -logic] is a good introductory material too.<br />
<br />
Chiaki Ohkura's [http://acl.ldc.upenn.edu/W/W03/W03-1408.pdf The Semantics of Metaphor in the Game Theoretic Semantics with at Least Two Coordination Equilibria] article tries to catch the concept of ''metaphor''.<br />
<br />
=== Relatedness to linear logic ===<br />
<br />
The Wikipedia article mentions also the relatedness of game theoretic semantics to ''linear logic''.<br />
[http://homepages.inf.ed.ac.uk/wadler/ Philip Wadler]'s page on [http://homepages.inf.ed.ac.uk/wadler/topics/linear-logic.html linear logic] describes the topic and its relatedness to many concepts concerning Haskell. [http://homepages.inf.ed.ac.uk/wadler/topics/linear-logic.html#lineartaste A taste of linear logic] can serve as an introductory article.<br />
<br />
== Parsing natural languages ==<br />
===Parsing Natural Language with X-SAIGA parser===<br />
<br />
The goal of the [http://www.cs.uwindsor.ca/~hafiz/proHome.html X-SAIGA] project is to create algorithms and implementations which enable the construction of language processors (recognizers, parsers, interpreters, translators, etc.) to be constructed as modular and efficient embedded executable specifications of grammars. The syntax analysis is done with a set of parser combinators by overcoming some long standing limitations -<br />
# the simple implementations of parser combinators require [[exponential]] time and space when parsing an ambiguous context free grammar.<br />
# like any top-down recursive descent parsing, the conventional parser combinators won't terminate while processing a left-recursive grammar (i.e. <code>s ::= s *> s *> term 'x'|empty</code>).<br />
<br />
As a part of the X-SAIGA project's syntax analysis, a [http://cs.uwindsor.ca/~hafiz/p46-frost.pdf recognition algorithm] that accommodates ambiguous grammars with direct [[left recursion|left-recursive]] rules is described by Frost and Hafiz in 2006. The algorithm curtails the otherwise ever-growing left-recursive parse by imposing depth restrictions. That algorithm was extended to a complete [http://cs.uwindsor.ca/~hafiz/iwpt-07.pdf parsing algorithm] to accommodate indirect as well as direct left-recursion in [[polynomial]] time, and to generate compact polynomial-size representations of the potentially-exponential number of parse trees for highly-ambiguous grammars by Frost, Hafiz and Callaghan in 2007. This extended algorithm accommodates indirect left-recursion by comparing its 'computed-context' with 'current-context'. The same authors also [http://cs.uwindsor.ca/~hafiz/PADL_PAPER_FINAL.pdf described their implementation of a set of parser combinators] written in the [[Haskell]] programming language based on the same algorithm in [http://www.ist.unomaha.edu/padl2008/ PADL 08]. The [http://www.cs.uwindsor.ca/~hafiz/proHome.html X-SAIGA] site has more about the algorithms, implementation details experimental results.<br />
<br />
===Monadic Compositional Parsing===<br />
Gordon J. Pace: [http://www.cs.um.edu.mt/~csaw/CSAW04/Proceedings/08.pdf Monadic Compositional Parsing with Context Using Maltese as a Case Study], see its [http://www.cs.um.edu.mt/~csaw/CSAW04/ context] too.<br />
<br />
== Other functional or Haskell-related approaches to linguistics ==<br />
<br />
* [http://cs.uwindsor.ca/~richard/PUBLICATIONS/NLI_LFP_SURVEY_DRAFT.pdf A Survey on the Use of Haskell in Natural-Language Processing] (Report by Richard A. Frost). It is also a part of Haskell Communities and Activities Report, [http://www.haskell.org/communities/11-2006/html/report.html Eleventh edition – November 30, 2006].<br />
* From [http://www.cs.chalmers.se/~aarne/ Aarne Ranta's homepage]<br />
** [http://www.cs.chalmers.se/~aarne/course-langtech/ Natural Language Technology], with (among others) [http://www.cs.chalmers.se/~aarne/course-langtech/lectures/lectures.html online course slides]. They give huge insights, for example, see the slide example which discusses [[Dependent type#Type theory|the concept of dependent type and Curry Howard isomorphism]] in lingustical context.<br />
* The [http://sanskrit.inria.fr/ZEN/ Zen Computational Linguistics Toolkit] has tools for efficiently processing linguistic data structures, like trees and automata. It's written in Literate O'Caml, though a Haskell port shouldn't be very hard to do.<br />
* The [http://nlpers.blogspot.com/ natural language processing blog] written by [http://www.isi.edu/~hdaume/ Hal Daume III].<br />
<br />
== Other linguistics-related resources ==<br />
<br />
Dr. [http://www.haskell.org/haskellwiki/Libraries_and_tools/Linguistics Günter Neumann]'s homepage.<br />
<br />
== Specific topics ==<br />
<br />
=== Lojban ===<br />
<br />
Lojban, an artificial language ([[Lojban|see a separate HaskellWiki page on it with references]].) “Lojban was not designed primarily to be an international language, however, but rather as a linguistic tool for studying and understanding language. Its linguistic and computer applications make Lojban unique among international languages...” (NC:WhLoj, page 15 par 1)<br />
<br />
=== Continuations in natural languages ===<br />
<br />
Some phenomena in natural languages can be grasped with the notion of [[continuation]]. For details, see<br />
Chris Barker's paper [http://www.cs.bham.ac.uk/~hxt/cw04/barker.pdf Continuations in Natural Language]. It is quite accessible to non-linguists.<br />
== References ==<br />
<br />
;barker2004cnl<br />
:Barker, Chris: [http://www.cs.bham.ac.uk/~hxt/cw04/barker.pdf Continuations in Natural Language] (pdf), 2004<br />
;nicholas2003wl<br />
:Nicholas, Nick and Cowan, John (ed.): What is Lojban? [http://www.lojban.org/ Logical Language Group], 2003. Available also [http://www.lojban.org/tiki/tiki-index.php?page=What+Is+Lojban%3F%2C+The+Book&bl online].<br />
;frost2006rnl <br />
:Frost, Richard: [http://cs.uwindsor.ca/~richard/PUBLICATIONS/NLI_LFP_SURVEY_DRAFT.pdf Realization of natural language interfaces using lazy functional programming] (pdf), 2006<br />
;frost2008pal<br />
:Frost, Richard; Hafiz, Rahmatullah and Callaghan, Paul: [http://cs.uwindsor.ca/~hafiz/PADL_PAPER_FINAL.pdf Parser Combinators for Ambiguous Left-Recursive Grammars.] Proceedings of the 10th International Symposium on Practical Aspects of Declarative Languages (PADL), ACM-SIGPLAN. January 2008, San Francisco, USA.<br />
;xsaiga2008exg<br />
:Frost, Richard; Hafiz, Rahmatullah and Callaghan, Paul: [http://cs.uwindsor.ca/~hafiz/proHome.html X-SAIGA] website - eXecutable SpecificAtIons of GrAmmars.<br />
<br />
[[Category:Theoretical foundations]]</div>DanielDeKokhttps://wiki.haskell.org/index.php?title=Mac_OS_X_Strike_Force&diff=37329Mac OS X Strike Force2010-10-24T10:38:00Z<p>DanielDeKok: With some work qtHaskell works on OS X.</p>
<hr />
<div>The following is a wiki page to centralize discussion of how to improve Haskell on Mac OS X. The name "strike force" comes from dons' [http://www.reddit.com/r/haskell/comments/d9wm2/is_it_time_for_a_strike_team_to_form_dedicated_to/ post on reddit] and the comments therein.<br />
<br />
== Goals ==<br />
<br />
=== Take care of the Haskell Platform installer ===<br />
<br />
The [http://github.com/gregorycollins/haskell-platform-osx-installer Haskell Platform OSX installer] is looking for a new maintainer (contact Greg: "greg at gregorycollins net").<br />
<br />
* who is willing to take over?<br />
** collaborate effort or single effort?<br />
* where to host?<br />
* what are the most presing things on the todo list?<br />
<br />
=== Make GUI-bindings easy to install ===<br />
<br />
Neither wxHaskell nor Gtk2hs with native Gtk seems to be easy to install.<br />
What's the state of HQK and qtHaskell?<br />
<br />
* We should provide at least one easy way to install one set of GUI bindings<br />
<br />
==== qtHaskell ====<br />
<br />
qtHaskell with i386 ghc can be compiled with the following steps:<br />
<br />
* Install Qt via MacPorts with the universal option set.<br />
* Install Perl 5.12 via MacPorts.<br />
* qmake will default to building x86_64 binaries, which does not work with 32-bit ghc. Modify ''/opt/local/libexec/qt4-mac/mkspecs/macx-g++/qmake.conf'', adding the following lines:<br />
<pre><br />
QMAKE_CXXFLAGS = -arch i386<br />
QMAKE_CFLAGS = -arch i386<br />
QMAKE_LFLAGS = -arch i386<br />
</pre><br />
* You could also create your own spec (''macx-g++-i386''?), and modify ''build.pl'' in the qtHaskell top-level directory to use this spec.<br />
* Build qtHaskell by executing the ''build'' script in the top-level directory.<br />
<br />
=== Make GHC 64 bit ===<br />
<br />
Mac OS X GHC Trac tickets:<br />
* [[http://hackage.haskell.org/trac/ghc/ticket/2965 2965]] is the main ticket, with lots of CC: people<br />
* [[http://hackage.haskell.org/trac/ghc/ticket/4163 4163]] gives some cross-compiling hope<br />
<br />
=== Reduce the number of GHC tickets ===<br />
<br />
* All [http://hackage.haskell.org/trac/ghc/query?groupdesc=1&group=status&order=priority&os=MacOS+X&col=id&col=summary&col=owner&col=type&col=status&col=priority&col=milestone Mac OS X GHC Trac tickets]<br />
<br />
== Information ==<br />
<br />
=== Wiki ===<br />
<br />
* [[Mac OS X]]<br />
* [[Mac OS X Common Installation Paths]]<br />
* [[Using Haskell in an Xcode Cocoa project]]<br />
<br />
=== Installing Haskell ===<br />
<br />
==== How Haskell is on OS X today ====<br />
<br />
The simplest methods are currently:<br />
<br />
* Binary GHC framework (/Library/Framework)<br />
* Binary Haskell platform framework (/Library/Framework)<br />
* MacPorts (/opt/local)<br />
* Fink (/sw)<br />
* Homebrew (symlinked into /usr/local ?)<br />
<br />
==== Manually compiled ====<br />
<br />
[[User:ChrisKuklewicz|ChrisKuklewicz]] 11:53, 6 September 2010 (UTC) I use MacPorts for the infrastructure and compile ghc against /opt/local but with --prefix=/opt/ghc-6.12.3 to keep it separate.<br />
<br />
==== Dynamic Linking ====<br />
<br />
working in GHC HEAD, not in any released version.<br />
<br />
<br />
==== Difficult libraries on OS X ====<br />
<br />
Libraries needed for ghc<br />
<br />
* iconv (older version in /usr is incompatible with new version from MacPorts)<br />
* readline (faked in /usr, provided by framework or MacPorts)<br />
* gmp (framework or MacPorts)<br />
<br />
Libraries needed for other packages? gtk?<br />
<br />
=== OS X code integration ===<br />
<br />
Write Haskell in XCode?<br />
<br />
Write ObjectiveC against GHC.Framework?<br />
<br />
FFI for Objective C from Haskell?<br />
<br />
=== Improvements? ===<br />
<br />
A cabal2pkg that maintains proper dependency tracking?<br />
<br />
Discussion forum for all this?</div>DanielDeKok