Archive for the ‘Uncategorized’ Category

I’m studying modal logic with the  Konyndyk textbook and (the philosophical aspect) of kripkean semantics with “Naming and necessity”. That should be a factor on deciding whether the new blog goes or not to planet haskell, as the recent drug-oriented material isn’t representative of *everything* I like about the world.

I’m moving all my blogging activity — I even transported the posts and comments from here — to   Whether the address at Planet Haskell should be changed is a judgement call on the Planet Haskell admins as the new blog contains vast amounts of nonhaskell material, (there is some maths though), but basically […]

I use, which means in effect I’m giving up large ammounts of privacy — the kind of music I listen to — for the sake of social networking (which in the end I don’t use at all) and fun stats. And that’s okay; at least the terms of service assure me that We won’t […]

Just been implementing sentential logic as I progress through the textbook. module Main where import Control.Monad data Formula a = Prim a | (Formula a) :+ (Formula a) | (Formula a) :* (Formula a) | (Formula a) :-> (Formula a) | Not (Formula a) deriving Show (<->) :: (Formula a) -> (Formula a) -> (Formula […]

import Char import List charRot r w = let base = (if isUpper w then 65 else 97) in if (isAlpha w) then chr (base + (mod ((ord w) – base +r) 26)) else w strRot r w = map (charRot r) w unRot w = [strRot r w | r<-[1..26]] countString st = [length […]

I’ve mentioned over and over and over again that I’m not a programmer, but a econometrician. Today we put that to good use. 1. The problem I can think of two ways of producing the list of divisors of a number: divisors x = [ y | y<-[1..x], (gcd x y) == y] fdivisors x […]

First of all, let me get this out of my system: Ok, now I have one more reason not to move out from The LaTeX people should, by now, have a simple “web” version of LaTeX that can be easily installed by dropping files in your cgi-bin directory. The vast majority of people with […]

In some of the graphs in Bycicling for Collatz (the divisibility graph with lots of arrows and the collatz one with 1, 2 and 4 highlighted) we manipulated the Haskell-generated graph either in the DOT file source or directly in the Graphviz GUI. The structure itself was somewhat confusing, too; the Dot class never managed […]

Q: How many people with ADD does it take to change a lightbulb? A: HEY! Let’s ride bikes! module Bikes where Graphviz is fun. Graphviz is fair. You may already have one. You may already be there: data Arr a = a :-> a Graphviz plots graphs from .DOT files consisting of remarkably simple syntax: […]

[] is really the gee-whiz monad. Haskell code that prints *all the five-number combinations of integers in [-5..5]: mapM (\x->[x+i | i<-[-5..5]]) [1..5] No, really, try it. This has to qualify as the “most surprisingly long output” line of code in all of computer programming.