Quick actions

cmd+k|ctrl+k

Navigation

Languages

Safe matrix addition

Snippet info

Language

Idris

Visibility

public

Author

rightfold

Created

2016-09-22T11:16:17Z

Updated

2016-09-22T11:20:22Z

module Main

import Data.Vect

Matr : Nat -> Nat -> Type -> Type
Matr w h a = Vect w (Vect h a)

total
add : Matr w h Int -> Matr w h Int -> Matr w h Int
add rs1 rs2 = Data.Vect.zipWith (\cs1, cs2 => Data.Vect.zipWith (+) cs1 cs2) rs1 rs2

main : IO ()
main = putStrLn "Hello World!"
INFO