src/Tools/Haskell/Haskell.thy
changeset 74187 6109a9105a7a
parent 74186 92e74f9305a4
child 74188 ea10e06adede
equal deleted inserted replaced
74186:92e74f9305a4 74187:6109a9105a7a
  1206 module Isabelle.Position (
  1206 module Isabelle.Position (
  1207   T, line_of, column_of, offset_of, end_offset_of, file_of, id_of,
  1207   T, line_of, column_of, offset_of, end_offset_of, file_of, id_of,
  1208   start, none, put_file, file, file_only, put_id, id, id_only,
  1208   start, none, put_file, file, file_only, put_id, id, id_only,
  1209   symbol, symbol_explode, symbol_explode_string, shift_offsets,
  1209   symbol, symbol_explode, symbol_explode_string, shift_offsets,
  1210   of_properties, properties_of, def_properties_of, entity_markup, make_entity_markup,
  1210   of_properties, properties_of, def_properties_of, entity_markup, make_entity_markup,
  1211   is_reported, is_reported_range, here,
  1211   Report, Report_Text, is_reported, is_reported_range, here,
  1212 
       
  1213   Range, no_range, no_range_position, range_position, range
  1212   Range, no_range, no_range_position, range_position, range
  1214 )
  1213 )
  1215 where
  1214 where
  1216 
  1215 
  1217 import Prelude hiding (id)
  1216 import Prelude hiding (id)
  1378   in Markup.entity kind name |> Markup.properties props
  1377   in Markup.entity kind name |> Markup.properties props
  1379 
  1378 
  1380 
  1379 
  1381 {- reports -}
  1380 {- reports -}
  1382 
  1381 
       
  1382 type Report = (T, Markup.T)
       
  1383 type Report_Text = (Report, Bytes)
       
  1384 
  1383 is_reported :: T -> Bool
  1385 is_reported :: T -> Bool
  1384 is_reported pos = isJust (offset_of pos) && isJust (id_of pos)
  1386 is_reported pos = isJust (offset_of pos) && isJust (id_of pos)
  1385 
  1387 
  1386 is_reported_range :: T -> Bool
  1388 is_reported_range :: T -> Bool
  1387 is_reported_range pos = is_reported pos && isJust (end_offset_of pos)
  1389 is_reported_range pos = is_reported pos && isJust (end_offset_of pos)
  2733 {-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
  2735 {-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
  2734 
  2736 
  2735 module Isabelle.Byte_Message (
  2737 module Isabelle.Byte_Message (
  2736     write, write_line,
  2738     write, write_line,
  2737     read, read_block, read_line,
  2739     read, read_block, read_line,
  2738     make_message, write_message, read_message, exchange_message,
  2740     make_message, write_message, read_message,
       
  2741     exchange_message, exchange_message0,
  2739     make_line_message, write_line_message, read_line_message,
  2742     make_line_message, write_line_message, read_line_message,
  2740     read_yxml, write_yxml
  2743     read_yxml, write_yxml
  2741   )
  2744   )
  2742 where
  2745 where
  2743 
  2746 
  2840 
  2843 
  2841 exchange_message :: Socket -> [Bytes] -> IO (Maybe [Bytes])
  2844 exchange_message :: Socket -> [Bytes] -> IO (Maybe [Bytes])
  2842 exchange_message socket msg = do
  2845 exchange_message socket msg = do
  2843   write_message socket msg
  2846   write_message socket msg
  2844   read_message socket
  2847   read_message socket
       
  2848 
       
  2849 exchange_message0 :: Socket -> [Bytes] -> IO ()
       
  2850 exchange_message0 socket msg = do
       
  2851   _ <- exchange_message socket msg
       
  2852   return ()
  2845 
  2853 
  2846 
  2854 
  2847 -- hybrid messages: line or length+block (with content restriction)
  2855 -- hybrid messages: line or length+block (with content restriction)
  2848 
  2856 
  2849 is_length :: Bytes -> Bool
  2857 is_length :: Bytes -> Bool