Re: [Haskell-cafe] prettyprint with IO

2012-04-13 Thread Stephen Tetley
Haskell-src-exts has had a monadic wrapper over HughesPJ for a long
time. It is just a Reader (not a transformer) so it can handle user
supplied spacing widths, etc.


On 13 April 2012 06:02, Warren Harris warrensomeb...@gmail.com wrote:

 Thanks for the suggestions. No sooner did I send my message than I came to
 the same conclusion of creating a monadic version of the combinators to
 simplify the migration.

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


Re: [Haskell-cafe] open source project for student

2012-04-13 Thread Dan Cristian Octavian
Hi Jeremy,

Thank you for your encouraging reply. I understand your points and agree
for the most part, especially with the mentorship discussion that you made.

I wasn't too sure about attempting to work on a more sizeable project
(although I preferred that) but if you are saying that it's a reasonable
thing to do, I might as well try that. I have already started checking out
the larger Haskell projects.

On Thu, Apr 12, 2012 at 12:04 PM, Jeremy O'Donoghue 
jeremy.odonog...@gmail.com wrote:

 Hi Dan,

 I am the maintainer of wxHaskell, but please don't let that worry you, as
 I'm actually not going to go on and recommend wxHaskell as an Open Source
 project for a relative beginner - it is architecturally complex, and you
 need to know as much C++ as you do Haskell. You might choose to *use*
 wxHaskell in any project you undertake, but that is a different matter.

 I'm also a software engineering manager in my day job, so I have a lot of
 experience of what a good intern (those who come to me have generally
 completed their second year of undergraduate studies in the UK) can achieve
 - usually in fairly hardcore embedded C++, but that's beside the point.

 On 11 April 2012 22:52, Dan Cristian Octavian danoctavia...@gmail.comwrote:


 I am a second year computer science student who is very interested in
  working on a haskell open source project. I have no particular focus on a
 certain type of application. I am open to ideas and to exploring new
 fields. What kind of project should I look for considering that I am a
 beginner? (Any particular project proposals would be greatly appreciated).


 Long experience of many types of software project tells me that before
 everything else you should choose something which interests you. You need a
 reason to want to understand, analyze and generally get stuck into a
 codebase, and having an interest is what gives you that motivation.

 At the same time, please don't let being a 'beginner' be too much of a
 barrier. I tell new interns that by the end of their internship they will
 be debugging multithreaded kernel-mode C++ code on an embedded target
 confidently and they look at me as though I am mad. However, they have all
 (so far) managed to succeed in doing just that kind of thing. Don't
 underestimate your ability to understand new concepts when you have a
 reason to focus hard on them.

 What will help you a great deal is good mentorship. Working on a project
 where the development team can take time to explain to you how (and why)
 they think things should be done in a particular way will accelerate your
 learning to a remarkable degree. Far more than 100 lectures, in fact. You
 should also try to choose a project which is well documented - this will
 help you to understand how everything hands together.

 Is the entry bar too high for most projects out there for somebody lacking
 experience such as me so that I should try getting some experience on my
 own first?


 It is amazing what you can do when you actually make a start! I'm assuming
 that you are somewhat familiar with Haskell at this point (e.g. worked your
 way through most of Learn You a Haskell or Real World Haskell, and felt
 like you grasped at least 50% - if you haven't, do that first).

 The key is to start with something fairly small and then use it to build
 up to something bigger. Most sizeable projects (wxHaskell, Gtk2Hs, Darcs,
 Yi, Yesod and many others) will have things on the 'to do' list which are
 not too large and maintainers who should be able to help.

 Would it be a better idea to try to hack on my own project rather than
 helping on an existing one?


 I think you would learn more by contributing to an existing project.
 Whether that is of overwhelming importance is a question only you can
 answer.

 Regards
 Jeremy

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


Re: [Haskell-cafe] open source project for student

2012-04-13 Thread Osager Prairie
Hi Dan:

Just to share a little bit of my humble experience.
I'm also a beginner and I'm intrested in directory manipulation related
code.
Tasks such as printing directory in a tree form etc.

So I search on Hackage and found several projects, most notably the
Directory.Tree project. It's a very modest size project and could be an
easy entry for some hacking.

I'm sure you have your own interests in a specific type of problems.
and I'm sure you can find a similar small project from Hackage.

Happy hacking


On Fri, Apr 13, 2012 at 11:41 AM, Dan Cristian Octavian 
danoctavia...@gmail.com wrote:


 Hi Jeremy,

 Thank you for your encouraging reply. I understand your points and agree
 for the most part, especially with the mentorship discussion that you made.

 I wasn't too sure about attempting to work on a more sizeable project
 (although I preferred that) but if you are saying that it's a reasonable
 thing to do, I might as well try that. I have already started checking out
 the larger Haskell projects.

 On Thu, Apr 12, 2012 at 12:04 PM, Jeremy O'Donoghue 
 jeremy.odonog...@gmail.com wrote:

 Hi Dan,

 I am the maintainer of wxHaskell, but please don't let that worry you, as
 I'm actually not going to go on and recommend wxHaskell as an Open Source
 project for a relative beginner - it is architecturally complex, and you
 need to know as much C++ as you do Haskell. You might choose to *use*
 wxHaskell in any project you undertake, but that is a different matter.

 I'm also a software engineering manager in my day job, so I have a lot of
 experience of what a good intern (those who come to me have generally
 completed their second year of undergraduate studies in the UK) can achieve
 - usually in fairly hardcore embedded C++, but that's beside the point.

 On 11 April 2012 22:52, Dan Cristian Octavian danoctavia...@gmail.comwrote:


 I am a second year computer science student who is very interested in
  working on a haskell open source project. I have no particular focus on a
 certain type of application. I am open to ideas and to exploring new
 fields. What kind of project should I look for considering that I am a
 beginner? (Any particular project proposals would be greatly appreciated).


 Long experience of many types of software project tells me that before
 everything else you should choose something which interests you. You need a
 reason to want to understand, analyze and generally get stuck into a
 codebase, and having an interest is what gives you that motivation.

 At the same time, please don't let being a 'beginner' be too much of a
 barrier. I tell new interns that by the end of their internship they will
 be debugging multithreaded kernel-mode C++ code on an embedded target
 confidently and they look at me as though I am mad. However, they have all
 (so far) managed to succeed in doing just that kind of thing. Don't
 underestimate your ability to understand new concepts when you have a
 reason to focus hard on them.

 What will help you a great deal is good mentorship. Working on a project
 where the development team can take time to explain to you how (and why)
 they think things should be done in a particular way will accelerate your
 learning to a remarkable degree. Far more than 100 lectures, in fact. You
 should also try to choose a project which is well documented - this will
 help you to understand how everything hands together.

 Is the entry bar too high for most projects out there for somebody
 lacking experience such as me so that I should try getting some experience
 on my own first?


 It is amazing what you can do when you actually make a start! I'm
 assuming that you are somewhat familiar with Haskell at this point (e.g.
 worked your way through most of Learn You a Haskell or Real World Haskell,
 and felt like you grasped at least 50% - if you haven't, do that first).

 The key is to start with something fairly small and then use it to build
 up to something bigger. Most sizeable projects (wxHaskell, Gtk2Hs, Darcs,
 Yi, Yesod and many others) will have things on the 'to do' list which are
 not too large and maintainers who should be able to help.

 Would it be a better idea to try to hack on my own project rather than
 helping on an existing one?


 I think you would learn more by contributing to an existing project.
 Whether that is of overwhelming importance is a question only you can
 answer.

 Regards
 Jeremy



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


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


[Haskell-cafe] is this an arrow?

2012-04-13 Thread Johannes Waldmann
Dear Cafe, I have the following types:

type Computer a b =  ( a - IO ( Maybe b ) )
type Transformer a b c d =  Computer a ( b, c - d )

For example, a SAT solver:
minisat :: Computer CNF Assignment,

and when I use it to solve an application problem
via transformation to SAT, I need
t :: Transformer Problem SAT Assignment Solution

Now - what is the proper abstraction? Is this an arrow somehow?
And is there already a type and a library that would
contain useful combinators like some of these:

http://autolat.imn.htwk-leipzig.de/gitweb/?p=box;a=blob;f=src/exotic/Strategy.hs;h=238b5f55fabf356e0ce484d0f6b882a06d6e6cfc;hb=HEAD

Thanks - J.W.



signature.asc
Description: OpenPGP digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Can cabal detect property of the platform ?

2012-04-13 Thread Vincent Hanquez

Hi Cafe,

Is there a way to have (some) cabal flags to autoconfigure themselves ?

For example, a SSE flag, i want the configure to default to on
when the building machine has SSE instruction available, and default
to off otherwise.

(of course, it wouldn't affect the user ability to override the default with -f)

It doesn't appears possible just using the cabal file. Is there a way
with the Setup.hs maybe ? or some other cunning plan ?

--
Vincent

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


Re: [Haskell-cafe] is this an arrow?

2012-04-13 Thread Daniel Peebles
On Fri, Apr 13, 2012 at 7:49 AM, Johannes Waldmann 
waldm...@imn.htwk-leipzig.de wrote:

 type Computer a b =  ( a - IO ( Maybe b ) )
 type Transformer a b c d =  Computer a ( b, c - d )


Computer looks like Kleisli (MaybeT IO), which would be a valid instance of
Arrow.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Template Haskell: Generate annotated function of a typeclass

2012-04-13 Thread Ismael Figueroa Palet
Hi all, I think this is the right place for the following questions and I
thank beforehand for your answers :-)


I'm experimenting with typeclasses and TH, and I want to define a 'macro'
that works more or less like this:

Given the name of a typeclass and a function, return the expressions
corresponding to the type-annotated instances, for instance

$(foo Show show)

should translate to:

[(show :: Int - String),  (show :: Bool - String), ]

for all instances currently in scope.

I'm currently playing with the isInstance function (I'm running GHC 7.4.1)
and can get a list of instances, and check if a given type is part of a
typeclass or not. But I don't know how to create the expression
corresponding to instantiated function, as above.

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


Re: [Haskell-cafe] Template Haskell: Generate annotated function of a typeclass

2012-04-13 Thread Michael Sloan
Hello!

It seems like you would want to use reifyInstances in order to get
all of the instances associated with a class.  Then, you can match up
the variables in each instance with the variables in the class
declaration, and create a mapping from the class variables to the
instance parameters.  Then, you can apply these mappings with substT:
http://hackage.haskell.org/packages/archive/haskell-src-meta/0.5.1.2/doc/html/Language-Haskell-Meta-Utils.html#v:substT

The result would also need to have the context of the instance,
perhaps reduced to just the constraints that mention the type
variables used in the selected function.

-Michael Sloan

On Fri, Apr 13, 2012 at 11:37 AM, Ismael Figueroa Palet
ifiguer...@gmail.com wrote:
 Hi all, I think this is the right place for the following questions and I
 thank beforehand for your answers :-)


 I'm experimenting with typeclasses and TH, and I want to define a 'macro'
 that works more or less like this:

 Given the name of a typeclass and a function, return the expressions
 corresponding to the type-annotated instances, for instance

 $(foo Show show)

 should translate to:

 [(show :: Int - String),  (show :: Bool - String), ]

 for all instances currently in scope.

 I'm currently playing with the isInstance function (I'm running GHC 7.4.1)
 and can get a list of instances, and check if a given type is part of a
 typeclass or not. But I don't know how to create the expression
 corresponding to instantiated function, as above.

 Thanks!
 --
 Ismael


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


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


Re: [Haskell-cafe] Template Haskell: Generate annotated function of a typeclass

2012-04-13 Thread Ismael Figueroa Palet
Thanks for your reply, in particular the reference to subsT!
I will work more on this next monday, and report my progress

Cheers!


2012/4/13 Michael Sloan mgsl...@gmail.com

 Hello!

 It seems like you would want to use reifyInstances in order to get
 all of the instances associated with a class.  Then, you can match up
 the variables in each instance with the variables in the class
 declaration, and create a mapping from the class variables to the
 instance parameters.  Then, you can apply these mappings with substT:

 http://hackage.haskell.org/packages/archive/haskell-src-meta/0.5.1.2/doc/html/Language-Haskell-Meta-Utils.html#v:substT

 The result would also need to have the context of the instance,
 perhaps reduced to just the constraints that mention the type
 variables used in the selected function.

 -Michael Sloan

 On Fri, Apr 13, 2012 at 11:37 AM, Ismael Figueroa Palet
 ifiguer...@gmail.com wrote:
  Hi all, I think this is the right place for the following questions and I
  thank beforehand for your answers :-)
 
 
  I'm experimenting with typeclasses and TH, and I want to define a 'macro'
  that works more or less like this:
 
  Given the name of a typeclass and a function, return the expressions
  corresponding to the type-annotated instances, for instance
 
  $(foo Show show)
 
  should translate to:
 
  [(show :: Int - String),  (show :: Bool - String), ]
 
  for all instances currently in scope.
 
  I'm currently playing with the isInstance function (I'm running GHC
 7.4.1)
  and can get a list of instances, and check if a given type is part of a
  typeclass or not. But I don't know how to create the expression
  corresponding to instantiated function, as above.
 
  Thanks!
  --
  Ismael
 
 
  ___
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe
 




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


Re: [Haskell-cafe] [Haskell] ANNOUNCE: notcpp-0.0.1

2012-04-13 Thread Henning Thielemann


On Fri, 13 Apr 2012, Ben Millwood wrote:


But I never liked using CPP: it completely defeats haskell-src-exts
and hence things like SourceGraph, and anyway it's not designed for
Haskell and doesn't at all understand its structure, or fit with its
syntax. With a little thought, I wondered if creative use of template
haskell might not achieve the same goal. It turned out it did, and
emboldened with this knowledge I set out to write a new package making
this technique available to others.


I never liked CPP in Haskell, too. The problem is: I also do not like 
Template Haskell. :-) Whereever possible I use a Cabal flag and a 
conditional Hs-Source-Dirs.


http://www.haskell.org/haskellwiki/Cabal/Developer-FAQ#Adapt_to_different_systems_without_CPP

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


[Haskell-cafe] [Announce] wxHaskell 0.90

2012-04-13 Thread Jeremy O'Donoghue
Hi Haskellers,

I am delighted to announce the release of wxHaskell 0.90. This release
represents a significant milestone for us as it includes support for
wxWidgets 2.9.x.

The release is avalable from Hackage and as a darcs repo from
http://code.haskell.org/wxhaskell. Build and installation instructions have
been updated on the Haskell wiki at
http://www.haskell.org/haskellwiki/Wxhaskell.

Highlights of the new release:

   - Builds and runs cleanly on 64 bit platforms (particularly MacOS X
   Lion).
   - The wxWidgets C wrapper is now built as a DLL on all platforms.
  - This is reported to enable meaningful use of wxHaskell in GHCi, at
  least on OS X and Windows.
  - It also theoretically allows wxc to be used independently of
  wxHaskell as the basis of a wxWidgets wrapper for other programming
  languages. Some D language hackers have expressed an interest in this.
  - New controls:
  - Styled Text Control (actually, this is reinstated as it was 'lost'
  a while back during cabalization)
  - OpenGL support
  - PropertyGrid control
   - Many events added in anticipation of wrapping more controls in the
   near future.

There were many contributors to this release, the most notable being Dave
Tapley (with the generous support of Mentics Inc.). Dave was responsible
for the refactoring of wxc and PropertyGrid support. Eric Kow put in quite
a bit of work with Kenny Frodo, Doaitse Swierstra and Alessandro Vermeulen
on MacOS support. There were a couple of contributions from long-time
wxHaskell contributor shelarcy, and bug reports, fixes and support from a
larger community than I ever realised we had.

Support for wxWidgets 2.8.x will continue in a 'maintenance mode'
continuing from the wxHaskell 0.13 codeline. If you continue to use the old
codeline, please take note of the changes to the procedure to get the
correct version for your needs. This is also documented at
http://www.haskell.org/haskellwiki/Wxhaskell.

Thanks to everyone involved.

Best regards

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