Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: haskell help

  1. #11
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You'll need Data.Char.toLower :: Char -> Char, Prelude.map :: (a -> b) -> [a] -> [b], Data.List.sortBy :: (Ord a) => (a -> a -> Ordering) -> [a] -> [a], and Data.Ord.comparing :: (Ord a) => (b -> a) -> b -> b -> Ordering:
    Code:
    import Data.List (sortBy)
    import Data.Char (toLower)
    import Data.Ord (comparing)
    
    orderWords = unwords . sortBy (comparing $ map toLower) . words
    Last edited by Twey; 10-24-2008 at 03:32 PM.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  2. The Following User Says Thank You to Twey For This Useful Post:

    guvdave123 (10-24-2008)

  3. #12
    Join Date
    Oct 2008
    Posts
    7
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey View Post
    You'll need Data.Char.toLower :: Char -> Char, Prelude.map :: (a -> b) -> [a] -> [b], Data.List.sortBy :: (Ord a) => (a -> a -> Ordering) -> [a] -> [a], and Data.Ord.comparing :: (Ord a) => (b -> a) -> b -> b -> Ordering:
    Code:
    import Data.List (sortBy)
    import Data.Char (toLower)
    import Data.Ord (comparing)
    
    orderWords = unwords . sortBy (comparing $ map toLower) . words
    twey is there anyway i can email you, just wanted to ask you summit about my code, but dont want to post it on here cause its part of my project and might get plagerised. tried your email but email keeps bouncing back and cant pm eitha. or any one else who can spare 5 mins! thanks

  4. #13
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    After you've replied to this message, you should be able to PM me (requires five posts first, to keep the spammers out).

    I must say, I thought my email account for this forum was still active. If not, no matter, PM me. You can also reach my main email account by removing the '-dd' from the email address I use here.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. The Following User Says Thank You to Twey For This Useful Post:

    guvdave123 (10-26-2008)

  6. #14
    Join Date
    Oct 2008
    Posts
    7
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    thanks mate

  7. #15
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Haskell HELP REQUIRE

    ok ------------------------------------
    Last edited by rjhelpdesk; 03-30-2009 at 12:13 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •