I hereby claim:
- I am cleichner on github.
- I am chas (https://keybase.io/chas) on keybase.
- I have a public key whose fingerprint is EB53 7E69 EAAC 25ED F926 9C92 4C07 A6D8 BE65 FBF6
To claim this, I am signing this object:
-- Copyright 2021 Google LLC. | |
-- SPDX-License-Identifier: Apache-2.0 | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE TypeOperators #-} | |
module Main where | |
import Data.Functor.Identity | |
import Data.Functor.Product |
I hereby claim:
To claim this, I am signing this object:
wrapM :: Monad m => (a -> b) -> (a -> m b) | |
wrapM = (return .) | |
-- same as wrapM f = \x -> return (f x) |
module KleisliComp where | |
import Control.Arrow | |
import Data.Foldable | |
import Data.Monoid | |
import Data.Monoid.Endomorphism | |
-- After explicitly writing the KleisliEndo instance, I realized that it could | |
-- be built using existing infrastructure, namely the Kleisli category instance | |
-- and the Monoid instance for category endomorphism composition. |
import Criterion.Main | |
prswap [] = [] | |
prswap (a:b:xs) = b:a:prswap xs | |
prswap' [] = [] | |
prswap' list = reverse (take 2 list) ++ prswap (drop 2 list) | |
main = defaultMain [ bgroup "prswap" [ bench "prswap [1..1000]" $ whnf prswap [1..1000] | |
, bench "prswap [1..10000]" $ whnf prswap [1..10000] |
import Control.Monad | |
import Data.List | |
data BF a = Add a | |
| Move a | |
| StartLoop | |
| EndLoop | |
| Write | |
| Read | |
| Zero |
''' | |
Null module: | |
Responds to all actions and requests for members with a null object. | |
For example, this code will execute the debugging tools in development, but | |
won't do anything in production. | |
if environment == development: | |
import ExpensiveDebugging | |
else: |
#!/usr/bin/env python | |
''' | |
The MIT License (MIT) | |
Copyright (c) 2013 Chas Leichner | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights |
Copyright 2014 Chas Leichner | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
| _ _ _ _ | _ _ _ _ _ | | |
| |_|_ |_|_ _| _|_ _ _| | | |
| |_ _|_ | |_| |_ _ _| |_| | |
|_| |_ _ _|_ _ _| |_ _| | |
| | |_ _ | |_|_|_ | _|_ | | |
| _| | |_|_ _| |_ _ | | | |
| | | _| |_| |_ _ _| | | | |
| |_| |_|_ _ | |_ _|_ _|_ | | | |
|_| _| _ _ _| | | | _ _ | |_| |