Skip to content

Instantly share code, notes, and snippets.

@myuon
myuon / Tensor.hs
Created January 18, 2014 07:48
テンソル積とZ/6Zの実装(Eqのインスタンスを定めるところがincomplete)
{-# LANGUAGE FlexibleInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleContexts, UndecidableInstances #-}
import Data.Bifunctor
import Data.Biapplicative
import Data.List
data Tensor a b = a :*: b deriving (Show)
class ShowAll c where
toList :: [c]