Re: [Haskell-cafe] AlternativePrelude extension

2010-01-16 Thread Sjur Gjøstein Karevoll
Laurdag 16. januar 2010 22.40.17 skreiv Malcolm Wallace:
  I'm thinking the syntax would be something like
  AlternativePrelude=MyPrelude.
 
 There is a general principle that the semantics of a program should be
 completely described by the source code itself, and not dependent on
 options that may or may not be specified elsewhere.  Hence, the idea
 of adding {-# LANGUAGE #-} pragmas, so that the source code is self-
 contained.
 
 Specifying {-# LANGUAGE NoImplicitPrelude #-} together with import
 MyPrelude satisfies this principle, as does {-# LANGUAGE
 AlternativePrelude=MyPrelude #-} in all files where it matters.  But
 the difference in usability is slight.
 
 If you are suggesting that {-# LANGUAGE AlternativePrelude=MyPrelude
 #-} should somehow escape the scope of the module it appears in, then
 I think we heading for less firm ground.
 
 Regards,
  Malcolm
 
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe
 

Having a LANGUAGE pragma, or indeed any pragma, escape the module it's used in 
would be pretty silly, wouldn't it?

In principle I'm a fan of the LANGUAGE pragmas. Self-contained source is 
usually much easier to read that source that depends on whatever command the 
author used to build the thing.

However, the option to set language extension globally is still available, 
either as an option to the compiler when building, or in the cabal file 
describing the package. Allowing an alternative prelude in this fashion makes 
it easier to switch out the standard for alternatives in existing projects 
just to see what might happen, how things are changed or just for giggles. It 
might not be advisable to do so in code you plan on unleashing on the world, 
but it would make experimenting with alternatives cheaper than it currently 
is.

-- 
Sjur Gjøstein Karevoll
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] AlternativePrelude extension

2010-01-15 Thread Sjur Gjøstein Karevoll
Here's an idea I'd like to air:

A new extension called AlternativePrelude. Like the NoImplicitPrelude 
extension we have already, this would disable implicitly importing the Prelude 
in every other module, but would also implicitly import a substitute.

The purpose is to make it easier to play around with alternative preludes. 
Today we have to specify NoImplicitPrelude, but also explicitly import our 
alternative everywhere, making the transition between the different preludes 
that much more painful. With this new extension, the alternative prelude can 
be specified in the cabal file, or on the command line when building. This will 
hopefully make the alternative prelude efforts a little bit more mainstream, 
giving us more data we can use to consider modifications to the current 
standard prelude.

I'm thinking the syntax would be something like 
AlternativePrelude=MyPrelude. This is new among the extensions in that it 
requires a parameter.

An alternative is an ImplicitImport extension that doesn't disable the 
implicit importing of the Prelude, but while this does serve the same purpose 
as the AlternativePrelude proposal, I think it might be easier to use it for 
nefarious purposes.

--
Sjur Gjøstein Karevoll
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Learning Haskell

2009-03-24 Thread Sjur Gjøstein Karevoll
må. den 23.03.2009 klokka 20:08 (-0700) skreiv Tom.Amundsen:
 How long did it take you to become proficient in Haskell? By that, I mean -
 how long until you were just as comfortable with Haskell as you were with
 your strongest language at that time?

It's been nine months since I first started learning, but for about five
months in the middle I didn't do any Haskell hacking (or much hacking at
all). Measuring completeness of knowledge, Haskell still ranks below
Python and Java, but measuring ability to solve a given problem Haskell
comes out on top. Of course, I've only been programming for two years
total...

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


Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Sjur Gjøstein Karevoll
I know what you're saying, in a way. There is much haskell code that's
completely illegible to me. I would say there is a difference between
Haskell and Perl though, in that Perl code is too smart aka. clever,
while Haskell code is usually simply, well, too smart. This means code
written using aspects of covariant generalized applicative combinators
in a closed Hillbert-space like continuous field ring, and other similar
nonsense.

There was a time when monadic parser combinator sounded equally
nonsensical to me. It doesn't anymore, and I'm a better programmer for
it, being able to reduce one of my earliest Haskell programs from 200 to
20 lines using that knowledge alone while making it more comprehensible
and maintainable at the same time.

The difference between Haskell and Perl is that Haskell programmers use
clever ideas while Perl programmers use clever abuse of syntax. Ideas,
at least, you have a hope of understanding sometime in the future.

ty. den 24.03.2009 klokka 18:41 (+0100) skreiv Manlio Perillo:
 Hi.
 
 In these days I'm discussing with some friends, that mainly use Python 
 as programming language, but know well other languages like Scheme, 
 Prolog, C, and so.
 
 These friends are very interested in Haskell, but it seems that the main 
 reason why they don't start to seriously learning it, is that when they 
 start reading some code, they feel the Perl syndrome.
 
 That is, code written to be too smart, and that end up being totally 
 illegible by Haskell novice.
 
 I too have this feeling, from time to time.
 
 
 Since someone is starting to write the Haskell coding style, I really 
 suggest him to take this problem into strong consideration.
 
 
 Manlio
 ___
 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] Re: Sugestion for a Haskell mascot

2009-03-13 Thread Sjur Gjøstein Karevoll
I've unconciously conditioned myself to think about rabbits with nukes each 
time I think about monads. Warm fuzzy things launching the missiles 
indeed.

On Friday 13 March 2009 02.38.29 Richard O'Keefe wrote:
 On 12 Mar 2009, at 11:08 pm, Satnam Singh wrote:
  I agree that looking for a mascot that is inspired by laziness is
  a bad idea from a P.R. perspective (I am tired of people walking out
  the room when I give Haskell talks to general audiences and explain
  lazy evaluation).

 Perhaps we should call it Just-In-Time evaluation.

 As for mascots, let's take a photo of Simon Peyton Jones,
 shrink him to hobbit size, give him furry feet, and announce
 that here is one of the warm fuzzy things we have in mind
 when we use monads.  (:-)

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

-- 
Sjur Gjøstein Karevoll
sjurberen...@gmail.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe