Giter Site home page Giter Site logo

classy-prelude's Introduction

classy-prelude

A typeclass-based Prelude. For more information, see the blog posts:

A common question/criticism raised about classy-prelude goes like this: type classes have to have laws associated with them, and you can't just use typeclasses to give names to difference things. I'd like to address that (recurring) comment once, here.

There are many tools and language features (both in Haskell and other environments) that can be used for purposes other than their originally intended purposes. Examples include:

  • Using OverloadedStrings to express routing (Scotty does this).
  • Using a data markup language as a programming language (XSLT).
  • Compile-time static assertions using a generic programming technique (C++ and Boost).

The examples are quite numerous. Do I like all of these? No. Many people know that I happen to utterly despise XSLT. But it's not sufficient to say "it's using a declarative data format to write code, it's bad." Using a tool for a different purpose is not really an argument as to why something is bad.

Now there are plenty of reasons you may dislike classy-prelude. I listed some in my own blog post. And I myself said in that post that a real namespacing solution would be better. But in the interim, this is (AFAIK) the only approach that gives the same namespacing result, or at least a close approximate. If you don't want to use it, that's fine. And in fact, that's the whole reason CorePrelude exists: so that others can experiment with other ideas!

But the statement that "Classes shouldn't be used just to be able to reuse the same name" is purely a subjective argument, and lacks any kind of explanation as to why you believe it. I'm happy to hear developed arguments for this, but such an assertion doesn't really further the discussion at all.

(Also, FWIW, classy-prelude is not the first time that type classes don't have associated laws. An example straight from base is IsString.)

classy-prelude's People

Contributors

jwiegley avatar maxcan avatar nikita-volkov avatar snoyberg avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.