1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
module Curry.SpanInfo where
import Curry.Span
data SpanInfo = SpanInfo Span [Span]
| NoSpanInfo
deriving (Eq, Show, Read)
class HasSpanInfo a where
getSpanInfo :: a -> SpanInfo
setSpanInfo :: SpanInfo -> a -> a
instance HasSpanInfo SpanInfo where
getSpanInfo = id
setSpanInfo = const
getSrcSpan :: HasSpanInfo a
=> a
-> Span
getSrcSpan a = case getSpanInfo a of
NoSpanInfo -> NoSpan
SpanInfo s _ -> s
getSrcInfoPoints :: HasSpanInfo a
=> a
-> [Span]
getSrcInfoPoints a = case getSpanInfo a of
NoSpanInfo -> []
SpanInfo _ ss -> ss
|