Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>I'm thinking that perhaps it's useful in some cases as a type-safe way of exhaustively handling "can't happen" cases</p> </blockquote> <p>This is precisely right.</p> <p>You could say that <code>absurd</code> is no more useful than <code>const (error "Impossible")</code>. However, it is type restricted, so that its only input can be something of type <code>Void</code>, a data type which is intentionally left uninhabited. This means that there is no actual value that you can pass to <code>absurd</code>. If you ever end up in a branch of code where the type checker thinks that you have access to something of type <code>Void</code>, then, well, you are in an <em>absurd</em> situation. So you just use <code>absurd</code> to basically mark that this branch of code should never be reached.</p> <p>"Ex falso quodlibet" literally means "from [a] false [proposition], anything follows". So when you find that you are holding a piece of data whose type is <code>Void</code>, you know you have false evidence in your hands. You can therefore fill <em>any</em> hole you want (via <code>absurd</code>), because from a false proposition, anything follows.</p> <p>I wrote a blog post about the ideas behind Conduit which has an example of using <code>absurd</code>. </p> <p><a href="http://unknownparallel.wordpress.com/2012/07/30/pipes-to-conduits-part-6-leftovers/#running-a-pipeline">http://unknownparallel.wordpress.com/2012/07/30/pipes-to-conduits-part-6-leftovers/#running-a-pipeline</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload