mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
151e12b81a
This is the result of: - Updating `./COPY` to say `2023`. - Running `./dev-env/bin/dade-copyright-headers update .`
50 lines
777 B
Haskell
50 lines
777 B
Haskell
-- Copyright (c) 2023 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
-- SPDX-License-Identifier: Apache-2.0
|
|
|
|
module InterfaceViews where
|
|
|
|
data View = View with
|
|
a : Int
|
|
b : Bool
|
|
|
|
interface I where
|
|
viewtype View
|
|
|
|
template T1
|
|
with
|
|
p : Party
|
|
a : Int
|
|
where
|
|
signatory p
|
|
interface instance I for T1 where
|
|
view = View with
|
|
a
|
|
b = True
|
|
|
|
template T2
|
|
with
|
|
p : Party
|
|
a : Int
|
|
where
|
|
signatory p
|
|
interface instance I for T2 where
|
|
view = View with
|
|
a
|
|
b = False
|
|
|
|
template T3
|
|
with
|
|
p : Party
|
|
a : Int
|
|
where
|
|
signatory p
|
|
interface instance I for T3 where
|
|
view = error "view crashed"
|
|
|
|
template T4
|
|
with
|
|
p : Party
|
|
a : Int
|
|
where
|
|
signatory p
|