Showing posts with label haskell. Show all posts
Showing posts with label haskell. Show all posts
Wednesday, March 9, 2011
Debuggable functions in Haskell
Long long time ago, when I was writing my first Haskell apps I had this huge problem - debugging. Because for majority of my life I was debugging more or less by writing printf(some variables) I was trying to apply this same pattern to Haskell. Unfortunately it didn't work. Didn't work because functions in Haskell do not allowed side effects, so if you don't want to (don't know how) use monads it isn't simple task to do, to write something to a screen, when you are in a function. In a last few years at least 10 people asked me how to write some debugging information on the screen, to try to figure out what is going on in your code, when it does not work, so far I was unable to point a good article how to do it, and I had to explain everything by myself. When you drink a beer with your mate and you try to explain how to use monads on a piece of tissue, it is not a good way, how to teach people anything. So I was so happy to find recently this article. It explains the problem (why it is not easy to write something on a screen when you are in a function) and how to deal with it so you don't need to refactor your code dramatically. Excellent work Darius, keep it up!
Sunday, December 19, 2010
Haskell Platform

Long, long time ago, when I started to learn haskell I spend many days trying to choose between ghc and hugs. Some people used ghc and other hugs, and there was no right choice. The problem for me was pretty big, because I come to haskell from the world of scheme, and in scheme sooner or later one finds out that there are 'some' differences between implementations, and later on when you want to use some public library you need to switch to other implementation, and code that you already have is not 100% compatible with it. And some migration errors are really hard to find. For example if an element of a code is not used usually, but will fire up when some weird criteria are met. Sad thing, isnt it?
Today, I created a new Windows box, and I needed an haskell environment. I tend to write my haskell code in Emacs (OurComments.org edition), and I love it, but today I went to haskell.org, and I was surprised to see that there are dramatical changes in the contend of this site (I don't use this site at all). And finally somebody have written some cool looking haskell tutorial. I love the look and feel of it (guys, great job there). Also I was surprised to see that they are promoting a Haskell Platform. Witch is an environment and set of tools on top of ghc. I gave it a shot, and so far so good. Good to see that the haskell is still improving. Let's keep it that way:)
Sunday, June 13, 2010
Iron stuff

.NET people tend to tell all those stories about languages that are ported to the .NET framework. Like Iron Python, Iron Ruby... Last week I examined how it looks like for Haskell and Scheme. In the Channel9 movies I heard few times that there is something like Iron Scheme and Iron Haskell, I wanted to compare VS against Emacs editor in terms of fast coding. I found out that there is no such thing as Iron Haskell, but there is a visual Haskell, and it only works for VS2003 and VS2005. It is just an interface via COM, between VS and GHC. This is also the reason why it won't work in VS2008 and VS2010. I've been thinking, what's the point of mentioning that there is a Haskell version for VS if not many people use VS2005 or VS2003 anymore. It is like saying that POSIX compatible application, written on Linux system will compile under MS Windows. Sure it will compile, but only on a Windows platform that was POSIX compliant (has a POSIX personality), and the last version that did that was Windows NT:) In other words telling me that there is an Implementation of Haskell running under VS and on top of .NET is like telling me to get a version of a Windows NT, and still not telling the truth, cause as far as I can see this Haskell does not behave as C# or VB.NET in terms of compilation to IL and running in a .NET framework.
Iron Scheme is a different story. It can be executed in VS2008, too bad that I want to use VS2010. It doesn't give me a power of a .NET framework and ability to use a scheme language. For me writing an application in this hybrid is like a functional-imperative disco polo kind of programming. A good subject for a separate post.
Wednesday, February 13, 2008
Design Patterns as Higher Order Datatype Generic Programs

Lately I was struggling with some other issues, that is why I'm updating my blog now with some older issues.
On 14 of November I went to the LHUG meeting to listen to the speech about Design Patterns as Higher-Order Datatype-Generic Programs. There is a video from this event. As always I asked some silly questions. The speech was excellent, but the best part was the beer after the event. I had an opportunity and pleasure to talk with Dr Jeremy Gibbons and discuss even more research that he did. As always beer conversation lead to the deeper thoughts about nature of programming languages. Enjoy the video.
Sunday, September 23, 2007
haskell meeting

Last Thursday I went on London HUG meeting. There were two speeches, one about finger trees, and other about games in Haskell. You can see me on both videos. Cheers.
Wednesday, September 12, 2007
haskell on Mac

I have to take my words back in terms of edgy development on Mac, in respect to Haskell. Basically thru macports system it is possible to install Haskell in version 6.6.1 or even development version 6.7 witch is really edgy now. And it is as easy as on Linux:
sudo port install ghc
or ghc-devel for 6.7 version. I was really surprised when I find out that really cool package hoc. It was created for Haskell version 6.1, of course it works perfectly for my needs – you can use it with the newer version but you can only use procedures that existed in version 6.6.1, but it means that sooner or later I will face problems. Any way, be aware that macports will additionally install ncurses-5.6, gmp-4.2.1, perl-5.8.8, readline-5.2, ghc-6.6.1. Do you see what I see Perl, what is this guy doing here. It reminds me this RoR installation - it installs PHP and actually uses it to do configuration tasks; how weird is that? By the way Instant Rails is the most common way to install RoR on windows.
Going back to main topic installation of all GHC dependencies will take a while, so be patient. If you never wrote anything in Haskell be sure to see if GHC is really the thing that you want. Basically majority of programs written for HUGS will not run on GHC and vice versa. It reminds me (again) about scheme, if you use guile your programs will probably not work on MIT/GNU Scheme or DrScheme. You will have to modify your code. Oh, well - life is taft.
But again don't you feel that it is sad. You program in a language that is understood only by a few, and you are unable to share it with all of those who understand it?
Subscribe to:
Posts (Atom)