• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
asayers Avatar
Name:Alex Sayers
Clan:University of Oxford
Member Since:Sep 2014
Last Seen:Feb 2015
Profiles:
Following:84
Followers:81
Allies:81
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations
  • Replies
  • Authored (3)
  • Needs Resolution
  • Custom User Avatar
    • asayers
    • commented on "Sorting lists by length and lexicographically" haskell solution
    • 11 years ago

    x and y are of type [a], not LengthList a.

    Consider these two ways of writing a function:

    foo :: LengthList a -> ...
    foo x = ...
    

    and

    foo :: LengthList a -> ...
    foo (LengthList x) = ...
    

    In the first example, the argument is simply bound to the identifier "x"; hence, x has type LengthList a. In the second example, however, we pattern-match on the argument, and bind the contents of the LengthList to the indentifier "x". So in the second example x has type [a].

    Hope that helps.

  • Custom User Avatar
    • asayers
    • commented on "Find the K'th Element of a List" haskell solution
    • 11 years ago

    Absolutely.

  • Custom User Avatar
    • asayers
    • commented on "Find the K'th Element of a List" haskell solution
    • 11 years ago

    This comment is hidden because it contains spoiler information about the solution

  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...