From e97817e947520c40c9520618c5d5d56747e4c0f1 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Thu, 24 Apr 2014 13:41:07 +0200 Subject: build with bidirectional type inference --- lib/Numeric/Container.hs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib/Numeric/Container.hs') diff --git a/lib/Numeric/Container.hs b/lib/Numeric/Container.hs index a31acfe..46c2903 100644 --- a/lib/Numeric/Container.hs +++ b/lib/Numeric/Container.hs @@ -28,7 +28,7 @@ module Numeric.Container ( -- * Basic functions module Data.Packed, - konst, -- build, + konst, build, constant, linspace, diag, ident, ctrans, @@ -188,3 +188,15 @@ instance Container Vector e => Konst e (Int,Int) Matrix where konst = konst' +class Build d f c e | d -> c, c -> d, f -> e, f -> d, f -> c, c e -> f, d e -> f + where + build :: d -> f -> c e + +instance Container Vector e => Build Int (e -> e) Vector e + where + build = build' + +instance Container Matrix e => Build (Int,Int) (e -> e -> e) Matrix e + where + build = build' + -- cgit v1.2.3