Skip to content

Instantly share code, notes, and snippets.

View Punie's full-sized avatar
😅
What's happening?

Hugo Saracino Punie

😅
What's happening?
View GitHub Profile
#!/usr/bin/env stack
-- stack --resolver lts-11.11 --install-ghc runghc
{-# LANGUAGE ScopedTypeVariables #-}
import Data.Foldable
import Data.Maybe (fromMaybe)
type FizzRule = Integer -> Maybe String
{-# LANGUAGE EmptyDataDeriving #-}
{-# LANGUAGE TypeOperators #-}
module ADTs where
import Prelude hiding ( map )
-- ZERO
data Void
@Punie
Punie / types.md
Last active July 30, 2018 11:58
Thoughts on types

Types

Type with zero inhabitants

data Void

This is a type that is fundamentally irrepresentable. There is absolutely no way to ever construct of value of that type.

<$> ::   (a ->   b) -> f a -> f b
<*> :: f (a ->   b) -> f a -> f b
=<< ::   (a -> f b) -> f a -> f b
package org.rollin.jhtest.domain;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Objects;
package org.rollin.jhtest.web.rest;
import com.codahale.metrics.annotation.Timed;
import org.rollin.jhtest.domain.Agent;
import org.rollin.jhtest.repository.AgentRepository;
import org.rollin.jhtest.web.rest.util.HeaderUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpHeaders;
@Punie
Punie / main.cpp
Created October 30, 2015 12:13
Hello World C++
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}