Skip to content

Latest commit

 

History

History
38 lines (31 loc) · 646 Bytes

README.md

File metadata and controls

38 lines (31 loc) · 646 Bytes
module Main where

import Effect
import NumPy
import Prelude
import Tutorials.Core
import Effect.Class.Console (logShow)

test :: S (S Z) :+: S Z
test = auto

n1 :: S Z
n1 = auto

n2 = eval (n1 :+: n1)

Compiled:

main :: Effect Unit
main = do
  logShow $ asInt $ eval test
  let x = init (eval $ n2 :+: n2) (eval $ n2 :+: n1) 6
  logShow x
  let y = init (eval $ n1 :+: n2) (eval $ n2 :+: n2) 6
  logShow $ x `matmul` y

Compile Error:

main :: Effect Unit
main = do
  logShow $ asInt $ eval test
  let x = init (eval $ n2 :+: n2) (eval $ n2 :+: n1) 6
  logShow $ x `matmul` x -- dim mismatch