Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Handy C includes sorting haskell program

I find it Handy when cleaning up C includes:



import Data.List

import System.IO

header_ord a b | Length a > length b = GT
| length a
header_ord a b = compare a b

order_headers = concat . (intersperse "\n") .
nub . (sortBy header_ord) . lines
main = do interact order_headers



This post first appeared on Tail -f /dev/random, please read the originial post: here

Share the post

Handy C includes sorting haskell program

×

Subscribe to Tail -f /dev/random

Get updates delivered right to your inbox!

Thank you for your subscription

×