{-# LANGUAGE PArr, ParallelListComp #-}
{-# OPTIONS -fvectorise #-}

module MinimalParTree (sumTreeWrapper) where

import qualified Prelude
import Data.Array.Parallel.Prelude
import Data.Array.Parallel.Prelude.Int


data Tree a = Node a [: Tree a :]


testTree :: Int -> Tree Int
testTree elem = Node elem emptyP 


sumTree :: Tree Int -> Int
sumTree (Node x ns) = x + sumP (mapP sumTree ns)

{-# NOINLINE sumTreeWrapper #-}
sumTreeWrapper :: Int -> Int
sumTreeWrapper elem =
  sumTree (testTree elem)