FS

Blog Archive

Monday, July 23, 2007

ICFP '07 Post-Mortem: II

Next up are some helper datatypes to make our code look more like the spec. If you're familiar with the contest (which is what I'm assuming) nothing here should look strange. For those of you that aren't familiar with the contest, here's the specification (PDF).


============
DNA.lhs


> module DNA where

> import Data.List

> type DNA = String
> type RNA = [DNA]

> subseq' a = genericDrop a

> subseq a b = genericTake (b-a) . genericDrop a

> (!!!) :: [a] -> Int -> Maybe a
> dna !!! x = if x >= length dna then Nothing else Just (dna !! x)

1 comment:

Jackie said...

You should write some posts about anime! Or maybe how cute I am.

Listening:

Watching:

  • House
  • Ride Back