Assignment 4 FAQs, Clarifications and Corrections

FAQs

  1. Q: What Prelude functions do you use in your solutions?
    A: Let's see!
    % comm -12 <(cat *.hs | tr -c A-Za-z0-9 \\n | sort -u) <(grep :: prelude.txt | cut -f1 -d' ' | sort)
    
    all
    concat
    const
    cycle
    drop
    error
    filter
    flip
    fromIntegral
    fst
    head
    id
    init
    last
    lines
    map
    not
    odd
    otherwise
    putStr
    read
    readFile
    replicate
    reverse
    tail
    take
    takeWhile
    uncurry
    unlines
    unwords
    words
    zip
    
    Note that's nothing exotic there, mostly just things we've talked about in class or that are mentioned in the a4 write-up. One exception is const, which is mentioned on slide 335, in the Point-free style section, which I promised an as-yet undelivered video on.

    But, the above doesn't show operators, which we know are functions with a symbolic name bound to them.

    Note that shell pipelines have a lot of similarity to the recursion-free computations you're doing on assignment 4. How much Java code would you have to write to do the computation expressed by the pipeline above? BTW, <(...) is process substitution in Bash.

Clarifications

None yet!

Corrections

None yet!