ssadler / hawk

Awk for Hoodlums
BSD 3-Clause "New" or "Revised" License
35 stars 2 forks source link

Input expressions won't compile #60

Closed ssadler closed 11 years ago

ssadler commented 11 years ago

Why don't these work?

echo "abc" | hawk id

Won't compile:
    No instance for (System.Console.Hawk.Representable.Rows (a0 -> a0))

echo "abc" | hawk 'take 2 . repeat'

Won't compile:
    No instance for (System.Console.Hawk.Representable.Rows
                   (a0 -> [a0])) 
ssadler commented 11 years ago

I was thinking of merging my rendering code which works and is quite simple, but I'm not sure I agree with #47 and #52. I do agree with having a flag for unsplit input, and maybe one for words but thats about it.

gelisam commented 11 years ago

Isn't Representable doing basically the same thing as hsl's rendering code? Hmm, maybe you're not talking about what I think you're talking about.

gelisam commented 11 years ago

The -l flag (and a few qualifiers) already allows your expressions to type check. Do you have other examples of what you are trying to accomplish?

> echo "abc" | hawk -l id
abc
> echo "abc" | hawk -l 'L.take 2 . L.repeat'
abc
abc
techtangents commented 11 years ago

Both of these examples work for me with the "hsl" command.

$ echo '1234'  | hsl 'id'
1234

$ echo "abc" | hsl 'take 2 . repeat'
abc
abc
gelisam commented 11 years ago

The bug concerned the "merge" branch, in which @melrief and I were working on merging the hsl and hsp projects into a new command named "hawk". This effort has continued under the gelisam/hawk repository.

@ssadler, would you like me to close all the remaining merge-only issues on this repo?