News aggregator

Why does David Turner say type classes were a bad idea?

Haskell on Reddit - Sat, 09/06/2014 - 6:10pm

At the end of this talk, David Turner states that he thinks type classes were a mistake to include in Haskell, but doesn't elaborate. (I'm still a Haskell beginner so I don't quite get the 'joke' that the audience does).

I've done a bit of searching but most results I get explain how to use type classes and not so much what the problems with them might be. This is one article I found that I think touches on some issues:

http://degoes.net/articles/principled-typeclasses/

submitted by D_duck
[link] [96 comments]
Categories: Incoming News

Mike Izbicki: Getting started with GitHub, vim, and bash

Planet Haskell - Sat, 09/06/2014 - 6:00pm
Getting started with GitHub, vim, and bash posted on 2014-09-07 by Rashid Goshtasbi and Kyler Rynear

Learning to use git, vim, and bash was hard for us. These tools are so different than the tools we used when we first learned to program. And they’re confusing! But our professor made us use them… and eventually… after we learned the tools… we discovered that we really like them! So we’ve put together a simple video guide to help you learn and enjoy these tools too. We did this as part of the CS100 open source software development class at UC Riverside.

Click here to watch the full playlist on YouTube.

Getting Started with GitHub <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/bap-NSjgPFg?rel=0&amp;vq=hd1080" width="697.6"></iframe>

This video shows you step by step how to create an account on GitHub. Then we see how to create our first repository called test, and transfer it from GitHub onto our local machine using the git clone command.

Creating a file, pushing to GitHub, and pulling from GitHub <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/UrLkCZaXg9o?rel=0&amp;vq=hd1080" width="697.6"></iframe>

How do we create files and upload them to GitHub? The touch <filename> command will create an empty file for you. The vim <filename> command will open a file in an advanced text editor that we talk about farther down the page. The git push command sends these files from your local machine up to GitHub, and the git pull command downloads files from GitHub and saves them to your local computer.

Branches <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/E8-hUsR7IXA?rel=0&amp;vq=hd1080" width="697.6"></iframe>

Branches let you work on files without messing up your original code. When you finish your changes, you can merge them into the master branch. This is the best part of version control.

Tags <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/WKG1u4Y_f3s?rel=0&amp;vq=hd1080" width="697.6"></iframe>

Most programs have different versions, for example: 1.0, 1.1, 1.2, 2.1 and 2.2.1. The git tag command let’s you create these versions. They’re just like a checkpoint in a Mario game!

Forking & Pull Requests <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/tTnL84EvJTM?rel=0&amp;vq=hd1080" width="697.6"></iframe>

Let’s say you want to contribute to an open source project, but you don’t have permission. In order to contribute to someone else’s repository, you must first “fork” it to create a repo that you do have push permission on. Then you issue a pull request through the GitHub website. This tells the owner of the original repo that you’ve made some changes they can incorporate.

The README.md file <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/4UTSEKzsSvM?rel=0&amp;vq=hd1080" width="697.6"></iframe>

README.md files are how you document your projects. The README.md should explain your program, give installation instructions, and list known bugs. Basically, it explains to someone else who has absolutely no idea what your program does or how to code, but it enables the user to understand the concepts and basic directions to execute your program. The .md extension at the end of the filename indicates that the file uses markdown formatting. This is a simple way to create nice looking documentation.

Learning vim

vim is an advanced text editor for Unix operating systems. It’s powerful, but all the commands are intimidating for first time users. Even though it’s hard to get used to at first, these videos will help you learn some of the basic commands and get comfortable with vim.

Getting Started <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/szTtE60fIt8?rel=0&amp;vq=hd1080" width="697.6"></iframe>

It was difficult at first trying to transverse my code while using vim. I was so used to being able to use my mouse and simply click where I wanted to go. There are many ways to maneuver inside of vim. Some may just use the h,j,k,l, up, down, left, right arrow keys, or the w, e, b keys to move. You can also press gg to go to the top of the code, G to go to the bottom of it, and (any number)G to go to the line number typed before the capital G.)

Cutting, copying, and pasting took a while to get used to when using vim. Sometimes there was something I wanted in my code that was in the instructions for the assignment. In order to paste I would use the p command, but I could not paste things from outside of vim into it. If I had something copied outside of vim, then to paste it into vim I would right click and just click paste. This would paste it wherever the cursor currently is. If you right click to copy, then it will not affect what is copied by using the commands y to copy or the commands d or x to cut. If those commands are used, the just clicking p will paste them. There are other ways to store more than one thing while copying or cutting, but these two ways were the most helpful as I learned how to use vim.

Another personal favorite features of vim, are the shift-a (takes you to the end of the line and into insert mode) and the shift-i (takes you to the beginning of the line and into insert mode) command. You can also press a to append after the cursor position, as well as i to insert before the current cursor position

vim also allows you to use the v or shift-v keys to highlight certain text or lines of code. You can then use other vim commands such as the copy, paste and delete keys to perform your needed actions.

Indentation <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/uuztdE_gixs?rel=0&amp;vq=hd1080" width="697.6"></iframe>

At first it felt very time consuming to indent multiple lines. I felt this way until I found about the V command. V lets users highlight a line and pressing up or down can highlight as many lines as they desire. All that was left to do was to type > after everything I wanted to indent was highlighted and it all would indented once to the right. Typing < would instead indent it to the left if I ever wanted to do that.

Deletion <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/x0BMbS2kWYc" width="697.6"></iframe>

There are two commands for deleting single character. x deletes the character that the cursor is on and moves the cursor to the right; and X deletes the character that the cursor is on and moves the cursor to the left.

The d command is a more powerful way to delete. d can be used with many different things after it. dd will delete the entire line. d$ will delete the rest of the current line. de will delete from where the cursor is up until the end of the word.

Replacing <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/d-quT7u3f_o" width="697.6"></iframe>

Lower case r can replace one letter while upper case R can replace one letter with many.

There are three c commands that I regularly use for replacement: ce , which deletes up until the end of the word that the cursor is currently on, then allows you to insert immediately; c$ , which deletes from where the cursor is up until the end of the line, then allows you to insert immediately; and cc , which deletes the whole line that the cursor is on and allows you to insert immediately at the beginning of the line.

Customizing your vim editor with the .vimrc file <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/VhAiVux6GBg?rel=0&amp;vq=hd1080" width="697.6"></iframe>

Ever wondered how’ve we get our vim editor to work in the way we have it versus the default editor? vim has a file where you can setup it’s defaults such as auto parentheses, auto-indent, and much more. By watching our video above, you can easily create new defaults for your vim editor that can cut time spent formating your text to spend more on coding.

Learning The Terminal

One of the best features of Unix operating systems is the powerful terminal they provide.

The ls command <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/xSSahh5HbUY?rel=0&amp;vq=hd1080" width="697.6"></iframe>

The ls command is one of the most used terminal commands.

The basic ls command, when run, displays the contents within the current working directory. Passing in a directory name as an argument will display the contents of that directory. It is also possible to pass in a path for a directory to display any directory, regardless of the directory the user is currently in.

If the -a flag is passed in with ls, all items in the current working directory prepended with a . are also displayed, along with the rest of the items.

Passing in the -l flag prints information for each item in the directory in a series of columns on a single line. The first column displays the read, write, and executable permissions for the main user, the group the current user is in, and any user in that order. The next column shows the owner of the item and the next column shows the group owner. The fourth column displays the size, in bytes, of the item. The fifth column displays the moment the item was created, and the last column displays the name of the item.

If the -R flag is passed in, the command will display the contents of the current directory, and then recursively enter every directory within the current directory and display the contents of that directory, then keep going into every directory until there are no more directories in the current directory it is in.

All these options are combinable for different uses. For example, I could use the -l and -a flags to display the information for the items prepended with a . , or use -R and -l together.

The cd and mv commands <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/1s5TiFbETh4?rel=0&amp;vq=hd1080" width="697.6"></iframe>

The cd and mv commands are crucial commands in order to actually use the terminal. Without cd, I would forever be stuck in their home directory. The mv command is necessary for moving files from one section of the hard drive. The cd command by itself will change the current working directory to the home directory. If passed a directory name that is within the current working directory, the current working directory will be changed to the name of the passed in directory. cd will also take a path as an argument. When a path is passed in, the current working directory will be changed to the directory specified by the path. When cd is passed with .., the directory will go backwards, the directory that the current directory is in.

The mv command will move an item within a certain directory to the directory passed in.

If the destination argument is not a path, the command will look for the destination in the current working directory. The destination argument can be a path, so I can move the item to any directory in the hard drive.

Recording terminal sessions via scripts <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/ZnIrku27C94?rel=0&amp;vq=hd1080" width="697.6"></iframe>

With the script command you can record the commands you run in your terminal into a file. By just typing script file_name_here, you can start a script. Also, you don’t need to worry about making a file beforehand, because when you specify the filename, it will make once for you in that name. Then when you’re done, type exit and your terminal will say your script session has ended and re-state the filename in which it recorded all your commands in.

How To SSH (into well server) <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/Letf4txWPic?rel=0&amp;vq=hd1080" width="697.6"></iframe>

Computer Science students have the ability to log into the school’s server using the ssh command. The way to do access the terminal is to type into the command terminal the following text:

ssh your_NetId@bell.cs.ucr.edu

If it is your first time entering the terminal, you will be asked to trust the encryption that the server uses, then prompted to enter the password associated with your NetID. Once doing all those steps, you will be brought to your home directory on the server. To exit the server, type exit into the command prompt and press enter.

A useful command that moves files to and from the remote server onto your home computer is the scp command. To put items from your home computer to the school’s server, type into the command prompt:

scp filename/absolute_path your_NetID@bell.cs.ucr.edu:absolute_path

To move items from the remote server onto your home computer, type into the command prompt:

scp your_NetID@bell.cs.ucr.edu:absolute_path absolute_path Spectacle App: Using the terminal and vim in one screen <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/j1fnYZp4foI?rel=0&amp;vq=hd1080" width="697.6"></iframe>

One of the first things I noticed about vim that I initially disliked was that it took over the terminal when I used it. Users with Windows 7 & above automatically have this ability by dragging your screen to the left or right border of your screen. Unfortunately, OS X users don’t have this built in ability. To get around this, OS X users can install the Spectacle App which will enable you to organize multiple windows on your screen with a touch of a buttom. To get around this issue, I started using two terminals instead of just one while I was programming. I would run vim using the first terminal and would run the executable in the second. It was as simple as using :w to save on vim instead of using :wq to save and quit. I could now test my code without ever having to close vim.

perror <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/GsoVzP3sRsA?rel=0&amp;vq=hd1080" width="697.6"></iframe>

When programming for unix based operating systems (which is a primary component of CS100), system calls are a prominent component for code. The perror function captures the error value (if returned) from the system call and prints to stdout an error message based on the system call and the type of error. It takes in one c-string argument, which is a message the user can pass in.

Categories: Offsite Blogs

Mike Izbicki: Getting started with GitHub, vim, and bash

Planet Haskell - Sat, 09/06/2014 - 6:00pm
Getting started with GitHub, vim, and bash posted on 2014-09-07 by Rashid Goshtasbi and Kyler Rynear

Learning to use git, vim, and bash was hard for us. These tools are so different than the tools we used when we first learned to program. And they’re confusing! But our professor made us use them… and eventually… after we learned the tools… we discovered that we really like them! So we’ve put together a simple video guide to help you learn and enjoy these tools too. We did this as part of the CS100 open source software development class at UC Riverside.

Click here to watch the full playlist on YouTube.

Getting Started with GitHub <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/bap-NSjgPFg?rel=0&amp;vq=hd1080" width="697.6"></iframe>

This video shows you step by step how to create an account on GitHub. Then we see how to create our first repository called test, and transfer it from GitHub onto our local machine using the git clone command.

Creating a file, pushing to GitHub, and pulling from GitHub <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/UrLkCZaXg9o?rel=0&amp;vq=hd1080" width="697.6"></iframe>

How do we create files and upload them to GitHub? The touch <filename> command will create an empty file for you. The vim <filename> command will open a file in an advanced text editor that we talk about farther down the page. The git push command sends these files from your local machine up to GitHub, and the git pull command downloads files from GitHub and saves them to your local computer.

Branches <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/E8-hUsR7IXA?rel=0&amp;vq=hd1080" width="697.6"></iframe>

Branches let you work on files without messing up your original code. When you finish your changes, you can merge them into the master branch. This is the best part of version control.

Tags <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/WKG1u4Y_f3s?rel=0&amp;vq=hd1080" width="697.6"></iframe>

Most programs have different versions, for example: 1.0, 1.1, 1.2, 2.1 and 2.2.1. The git tag command let’s you create these versions. They’re just like a checkpoint in a Mario game!

Forking & Pull Requests <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/tTnL84EvJTM?rel=0&amp;vq=hd1080" width="697.6"></iframe>

Let’s say you want to contribute to an open source project, but you don’t have permission. In order to contribute to someone else’s repository, you must first “fork” it to create a repo that you do have push permission on. Then you issue a pull request through the GitHub website. This tells the owner of the original repo that you’ve made some changes they can incorporate.

The README.md file <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/4UTSEKzsSvM?rel=0&amp;vq=hd1080" width="697.6"></iframe>

README.md files are how you document your projects. The README.md should explain your program, give installation instructions, and list known bugs. Basically, it explains to someone else who has absolutely no idea what your program does or how to code, but it enables the user to understand the concepts and basic directions to execute your program. The .md extension at the end of the filename indicates that the file uses markdown formatting. This is a simple way to create nice looking documentation.

Learning vim

vim is an advanced text editor for Unix operating systems. It’s powerful, but all the commands are intimidating for first time users. Even though it’s hard to get used to at first, these videos will help you learn some of the basic commands and get comfortable with vim.

Getting Started <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/szTtE60fIt8?rel=0&amp;vq=hd1080" width="697.6"></iframe>

It was difficult at first trying to transverse my code while using vim. I was so used to being able to use my mouse and simply click where I wanted to go. There are many ways to maneuver inside of vim. Some may just use the h,j,k,l, up, down, left, right arrow keys, or the w, e, b keys to move. You can also press gg to go to the top of the code, G to go to the bottom of it, and (any number)G to go to the line number typed before the capital G.)

Cutting, copying, and pasting took a while to get used to when using vim. Sometimes there was something I wanted in my code that was in the instructions for the assignment. In order to paste I would use the p command, but I could not paste things from outside of vim into it. If I had something copied outside of vim, then to paste it into vim I would right click and just click paste. This would paste it wherever the cursor currently is. If you right click to copy, then it will not affect what is copied by using the commands y to copy or the commands d or x to cut. If those commands are used, the just clicking p will paste them. There are other ways to store more than one thing while copying or cutting, but these two ways were the most helpful as I learned how to use vim.

Another personal favorite features of vim, are the shift-a (takes you to the end of the line and into insert mode) and the shift-i (takes you to the beginning of the line and into insert mode) command. You can also press a to append after the cursor position, as well as i to insert before the current cursor position

vim also allows you to use the v or shift-v keys to highlight certain text or lines of code. You can then use other vim commands such as the copy, paste and delete keys to perform your needed actions.

Indentation <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/uuztdE_gixs?rel=0&amp;vq=hd1080" width="697.6"></iframe>

At first it felt very time consuming to indent multiple lines. I felt this way until I found about the V command. V lets users highlight a line and pressing up or down can highlight as many lines as they desire. All that was left to do was to type > after everything I wanted to indent was highlighted and it all would indented once to the right. Typing < would instead indent it to the left if I ever wanted to do that.

Deletion <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/x0BMbS2kWYc" width="697.6"></iframe>

There are two commands for deleting single character. x deletes the character that the cursor is on and moves the cursor to the right; and X deletes the character that the cursor is on and moves the cursor to the left.

The d command is a more powerful way to delete. d can be used with many different things after it. dd will delete the entire line. d$ will delete the rest of the current line. de will delete from where the cursor is up until the end of the word.

Replacing <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/d-quT7u3f_o" width="697.6"></iframe>

Lower case r can replace one letter while upper case R can replace one letter with many.

There are three c commands that I regularly use for replacement: ce , which deletes up until the end of the word that the cursor is currently on, then allows you to insert immediately; c$ , which deletes from where the cursor is up until the end of the line, then allows you to insert immediately; and cc , which deletes the whole line that the cursor is on and allows you to insert immediately at the beginning of the line.

Customizing your vim editor with the .vimrc file <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/VhAiVux6GBg?rel=0&amp;vq=hd1080" width="697.6"></iframe>

Ever wondered how’ve we get our vim editor to work in the way we have it versus the default editor? vim has a file where you can setup it’s defaults such as auto parentheses, auto-indent, and much more. By watching our video above, you can easily create new defaults for your vim editor that can cut time spent formating your text to spend more on coding.

Learning The Terminal

One of the best features of Unix operating systems is the powerful terminal they provide.

The ls command <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/xSSahh5HbUY?rel=0&amp;vq=hd1080" width="697.6"></iframe>

The ls command is one of the most used terminal commands.

The basic ls command, when run, displays the contents within the current working directory. Passing in a directory name as an argument will display the contents of that directory. It is also possible to pass in a path for a directory to display any directory, regardless of the directory the user is currently in.

If the -a flag is passed in with ls, all items in the current working directory prepended with a . are also displayed, along with the rest of the items.

Passing in the -l flag prints information for each item in the directory in a series of columns on a single line. The first column displays the read, write, and executable permissions for the main user, the group the current user is in, and any user in that order. The next column shows the owner of the item and the next column shows the group owner. The fourth column displays the size, in bytes, of the item. The fifth column displays the moment the item was created, and the last column displays the name of the item.

If the -R flag is passed in, the command will display the contents of the current directory, and then recursively enter every directory within the current directory and display the contents of that directory, then keep going into every directory until there are no more directories in the current directory it is in.

All these options are combinable for different uses. For example, I could use the -l and -a flags to display the information for the items prepended with a . , or use -R and -l together.

The cd and mv commands <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/1s5TiFbETh4?rel=0&amp;vq=hd1080" width="697.6"></iframe>

The cd and mv commands are crucial commands in order to actually use the terminal. Without cd, I would forever be stuck in their home directory. The mv command is necessary for moving files from one section of the hard drive. The cd command by itself will change the current working directory to the home directory. If passed a directory name that is within the current working directory, the current working directory will be changed to the name of the passed in directory. cd will also take a path as an argument. When a path is passed in, the current working directory will be changed to the directory specified by the path. When cd is passed with .., the directory will go backwards, the directory that the current directory is in.

The mv command will move an item within a certain directory to the directory passed in.

If the destination argument is not a path, the command will look for the destination in the current working directory. The destination argument can be a path, so I can move the item to any directory in the hard drive.

Recording terminal sessions via scripts <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/ZnIrku27C94?rel=0&amp;vq=hd1080" width="697.6"></iframe>

With the script command you can record the commands you run in your terminal into a file. By just typing script file_name_here, you can start a script. Also, you don’t need to worry about making a file beforehand, because when you specify the filename, it will make once for you in that name. Then when you’re done, type exit and your terminal will say your script session has ended and re-state the filename in which it recorded all your commands in.

How To SSH (into well server) <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/Letf4txWPic?rel=0&amp;vq=hd1080" width="697.6"></iframe>

Computer Science students have the ability to log into the school’s server using the ssh command. The way to do access the terminal is to type into the command terminal the following text:

ssh your_NetId@bell.cs.ucr.edu

If it is your first time entering the terminal, you will be asked to trust the encryption that the server uses, then prompted to enter the password associated with your NetID. Once doing all those steps, you will be brought to your home directory on the server. To exit the server, type exit into the command prompt and press enter.

A useful command that moves files to and from the remote server onto your home computer is the scp command. To put items from your home computer to the school’s server, type into the command prompt:

scp filename/absolute_path your_NetID@bell.cs.ucr.edu:absolute_path

To move items from the remote server onto your home computer, type into the command prompt:

scp your_NetID@bell.cs.ucr.edu:absolute_path absolute_path Spectacle App: Using the terminal and vim in one screen <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/j1fnYZp4foI?rel=0&amp;vq=hd1080" width="697.6"></iframe>

One of the first things I noticed about vim that I initially disliked was that it took over the terminal when I used it. Users with Windows 7 & above automatically have this ability by dragging your screen to the left or right border of your screen. Unfortunately, OS X users don’t have this built in ability. To get around this, OS X users can install the Spectacle App which will enable you to organize multiple windows on your screen with a touch of a buttom. To get around this issue, I started using two terminals instead of just one while I was programming. I would run vim using the first terminal and would run the executable in the second. It was as simple as using :w to save on vim instead of using :wq to save and quit. I could now test my code without ever having to close vim.

perror <iframe allowfullscreen="allowfullscreen" frameborder="0" height="419.65" src="https://www.youtube.com/embed/GsoVzP3sRsA?rel=0&amp;vq=hd1080" width="697.6"></iframe>

When programming for unix based operating systems (which is a primary component of CS100), system calls are a prominent component for code. The perror function captures the error value (if returned) from the system call and prints to stdout an error message based on the system call and the type of error. It takes in one c-string argument, which is a message the user can pass in.

Categories: Offsite Blogs

Joachim Breitner: ICFP 2014

Planet Haskell - Sat, 09/06/2014 - 4:46pm

Another on-my-the-journey-back blog post; this time from the Frankfurt Airport Train Station – my flight was delayed (if I knew that I could have watched the remaining Lightning Talks), and so was my train, but despite 5min of running through the Airport just not enough. And now that the free 30 Minutes of Railway Station Internet are used up, I have nothing else to do but blog...

Last week I was attending ICFP 2014 in Gothenburg, followed by the Haskell Symposium and the Haskell Implementors Workshop. The justification to attend was the paper on Safe Coercions (joint work with Richard Eisenberg, Simon Peyton Jones and Stephanie Weirich), although Richard got to hold the talk, and did so quite well. So I got to leisurely attend the talks, while fighting the jet-lag that I brought from Portland.

There were – as expected – quite a few interesting talks. Among them the first keynote, Kathleen Fisher on the need for formal methods in cars and toy-quadcopters and unmanned battle helicopters, which made me conclude that my Isabelle skills might eventually become relevant in practical applications. And did you know that if someone gains access to your car’s electronics, they can make the seat belt pull you back hard?

Stefanie Weirich’s keynote (and the subsequent related talks by Jan Stolarek and Richard Eisenberg) on what a dependently typed Haskell would look like and what we could use it for was mouth-watering. I am a bit worried that Haskell will be become a bit obscure for newcomers and people that simply don’t want to think about types too much, on the other hand it seems that Haskell as we know it will always stay there, just as a subset of the language.

Similarly interesting were refinement types for Haskell (talks by Niki Vazou and by Eric Seidel), in the form of LiquidTypes, something that I have not paid attention to yet. It seems to be a good way for more high assurance in Haskell code.

Finally, the Haskell Implementors Workshop had a truckload of exciting developments in and around Haskell: More on GHCJS, Partial type signatures, interactive type-driven development like we know it from Agda, the new Haskell module system and amazing user-defined error messages – the latter unfortunately only in Helium, at least for now.

But it’s not the case that I only sat and listened. During the Haskell Implementors Workshop I held a talk “Contributing to GHC” with a live demo of me fixing a (tiny) bug in GHC, with the aim of getting more people to hack on GHC (slides, video). The main message here is that it is not that big of deal. And despite me not actually saying much interesting in the talk, I got good feedback afterwards. So if it now actually motivates someone to contribute to GHC, I’m even more happier.

And then there is of course the Hallway Track. I discussed the issues with fusing a left fold (unfortunately, without a great solution). In order to tackle this problem more systematically, John Wiegley and I created the beginning of a “List Fusion Lab”, i.e. a bunch of list benchmark and the possibility to compare various implementations (e.g. with different RULES) and various compilers. With that we can hopefully better assess the effect of a change to the list functions.

PS: The next train is now also delayed, so I’ll likely miss my tram and arrive home even later...

PPS: I really have to update my 10 year old picture on my homepage (or redesign it completely). Quite a few people knew my name, but expected someone with shoulder-long hair...

PPPS: Haskell is really becoming mainstream: I just talked to a randomly chosen person (the boy sitting next to me in the train), and he is a Haskell enthusiast, building a structured editor for Haskell together with his brother. And all that as a 12th-grader...

Categories: Offsite Blogs

Map data structure of entire application?

Haskell on Reddit - Sat, 09/06/2014 - 3:38pm

Anyone know of a utility that could map the data structure of an application? I guess that in a statically typed language it should be possible to trace the data dependencies of all variables and create a graph of them, where variables are nodes and functions are edges. Is there anything like this?

submitted by scottansan
[link] [2 comments]
Categories: Incoming News

ANN: Helium now available from Hackage

General haskell list - Sat, 09/06/2014 - 1:45pm
Dear Haskellers, I am happy to inform you that the programmer-friendly Helium Haskell compiler, known for its focus on error messages and hints, domain specific type error diagnosis, and its compilation logging facility, is now available from Hackage. All you need to do is cabal install helium cabal install lvmrun and you should be ready to go. The system has been tested under various instances of Windows, Mac, and Linux. To use Helium, there is a texthint program that is much like ghci (but less powerful), and a runhelium program that behaves like runhaskell. NB. the Hint environment is not yet availalble in this way (and, being pure Java, I am not sure if we will make it available in this way), and the server for logging the compiled programs is also not made available in this way. If you have a need for either of these, please e-mail me. There is a website too: http://www.cs.uu.nl/foswiki/Helium/WebHome To dispell one of the frequent misunderstandings about Helium: Helium DOES support a for
Categories: Incoming News

Scratch jr

Lambda the Ultimate - Sat, 09/06/2014 - 11:45am

Scratch jr is an iPad version of the Scratch environment, designed with young kids in mind. It is the best kid-oriented programming tool I tried so far, and my five year old has great fun making "movies" with it. As I noted on twitter an hour after installing, the ability to record your own voice and use it for your sprites is a killer feature. Check it out!

Categories: Offsite Discussion

Scala woes?

Lambda the Ultimate - Sat, 09/06/2014 - 6:12am

A fork in the back? See discussion over at HN. People in the know are encouraged to shed light on the situation.

Categories: Offsite Discussion

Tim Docker: A New Charting API

Planet Haskell - Fri, 09/05/2014 - 11:34pm

One of the challenges with building a library like Chart is the tension between ease of use and flexibility. Users want to produce charts with a minimum of code up front, but later want to refine the details. The chart library addresses this through the use of "defaulted records" using Data.Default.Class. Because such records are often nested, we rely on the somewhat intimidating lens library to modify the default values. We end up with code to create chart elements like this:

sinusoid2 = plot_points_title .~ "fn(x)" $ plot_points_values .~ mydata $ plot_points_style . point_color .~ opaque red $ def

This is much simpler and cleaner that the corresponding code using native record accessors, but it still has a certain amount of syntactic overhead.

I’ve added a simple state monad to the library to further clean up the syntax. The state of the monad is the value being constructed, allowing the use of the monadic lens operators. The above code sample becomes:

sinusoid2 = execEC $ do plot_points_title .= "fn(x)" plot_points_values .= mydata plot_points_style . point_color .= opaque red

This may seem only a minor syntactic improvement, but it adds up over an typical chart definition.

A few other changes further reduce the clutter in charting code:

  • A new Easy module that includes helper functions and key dependencies
  • Simpler "toFile" functions in the rendering backends
  • Automatic sequencing of colours for successive plots

All this means that a simple plot can now be a one liner:

import Graphics.Rendering.Chart.Easy import Graphics.Rendering.Chart.Backend.Cairo mydata :: [Double,Double] mydata = ... main = toFile def "test.png" $ plot $ points "lines" mydata

But this extends naturally to more complex charts. The code differences between the new stateful API versus the existing API can been seen in this example.

The stateful API is available in chart v1.3 It is a thin layer over the existing API – both will be continue to be available in the future.


Categories: Offsite Blogs

Can't create a static Linux executable when usinghmatrix

haskell-cafe - Fri, 09/05/2014 - 10:02pm
Hi Cafe, I am trying to build a static exec to be run on another machine, and I failed probably due to hmatrix. How can I fix this? Thanks! Test code: import Numeric.LinearAlgebra.Data main = print (fromLists [[2,3,3], [2,3,3]] :: Matrix Double) When complied with "ghc -O2 -static -optc-static -optl-static test.hs -optl-pthread", gave me lots of errors: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgees.o): In function `dgees_': (.text+0xbc4): undefined reference to `dcopy_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgees.o): In function `dgees_': (.text+0xed9): undefined reference to `dswap_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgees.o): In function `dgees_': (.text+0x1304): undefined reference to `dswap_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgees.o): In function `dgees_': (.text+0x1377): undefined reference to `dswap_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dg
Categories: Offsite Discussion

Dependent Haskell

Haskell on Reddit - Fri, 09/05/2014 - 7:17pm
Categories: Incoming News

IDE for Haste projects

Haskell on Reddit - Fri, 09/05/2014 - 10:36am
Categories: Incoming News